Skip to first unread message

Amir Reda

unread,
Mar 31, 2014, 4:41:08 PM3/31/14
to ns-3-...@googlegroups.com, Kostantinos Katsaros, Tommaso Pecorella
dear all
hope all are well
if i have 2 different node containers (gs and AN) AN has 3 nodes and gs has one node the gs is constant mobility

my question is if i want make the 3 nodes (AN) each one of the three move in a certain rectangle boundaries and each rectangle is away from the others about 20000m

i have looked at the mobility modules but there are nothing to do l movement for each node with different spaces between each other

can you please show me how to solve this problem 

--
Warmest regards and best wishes for a good health,urs sincerely
mero

Amir Reda

unread,
Mar 31, 2014, 5:50:24 PM3/31/14
to ns-3-...@googlegroups.com, Kostantinos Katsaros, Tommaso Pecorella
dear all
hope all are well
if i have 2 different node containers (gs and AN) AN has 3 nodes and gs has one node the gs is constant mobility

my question is if i want make the 3 nodes (AN) each one of the three move in a certain rectangle boundaries and each rectangle is away from the others about 20000m

i have looked at the mobility modules but there are nothing to do l movement for each node with different spaces between each other

i have write this part of code

  MobilityHelper gmobility;
  gmobility.SetPositionAllocator ("ns3::GridPositionAllocator",
                                 "MinX", DoubleValue (1000.0),
                                 "MinY", DoubleValue (1000.0),
                                 "DeltaX", DoubleValue (0.0),
                                 "DeltaY", DoubleValue (0.0),
                                 "GridWidth", UintegerValue (1),
                                 "LayoutType", StringValue ("RowFirst"));
  gmobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  gmobility.Install (gNodes);

  MobilityHelper mobility;
  mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
                                 "MinX", DoubleValue (0.0),
                                 "MinY", DoubleValue (0.0),
                                 "DeltaX", DoubleValue (2000.0),
                                 "DeltaY", DoubleValue (2000.0),
                                 "GridWidth", UintegerValue (1),
                                 "LayoutType", StringValue ("RowFirst"));
  mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
                             "Mode", StringValue ("Distance"),
                             "Distance", StringValue ("1000"),
                             "Speed", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"),
                             "Bounds", StringValue ("0|200|0|200"));
  mobility.Install (anNodes);

i got this error message after compilation in run time

Creating 2 anNodes.
assert failed. cond="m_bounds.IsInside (position)", file=../src/mobility/model/random-walk-2d-mobility-model.cc, line=168
terminate called without an active exception
Command ['/home/amirale32/ns-allinone-3.15/ns-3.15/build/scratch/aero2dtest'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

can you please show me what is wrong here

Konstantinos

unread,
Mar 31, 2014, 5:54:53 PM3/31/14
to ns-3-...@googlegroups.com, Kostantinos Katsaros, Tommaso Pecorella
You can install different mobility models on different nodes. Just create a random mobility for each rectangle, and install it individually on the three nodes.

Konstantinos

unread,
Mar 31, 2014, 5:59:34 PM3/31/14
to ns-3-...@googlegroups.com, Kostantinos Katsaros, Tommaso Pecorella


On Monday, March 31, 2014 10:50:24 PM UTC+1, Amir reda wrote:
dear all
hope all are well
if i have 2 different node containers (gs and AN) AN has 3 nodes and gs has one node the gs is constant mobility

my question is if i want make the 3 nodes (AN) each one of the three move in a certain rectangle boundaries and each rectangle is away from the others about 20000m

i have looked at the mobility modules but there are nothing to do l movement for each node with different spaces between each other

i have write this part of code

  MobilityHelper gmobility;
  gmobility.SetPositionAllocator ("ns3::GridPositionAllocator",
                                 "MinX", DoubleValue (1000.0),
                                 "MinY", DoubleValue (1000.0),
                                 "DeltaX", DoubleValue (0.0),
                                 "DeltaY", DoubleValue (0.0),
                                 "GridWidth", UintegerValue (1),
                                 "LayoutType", StringValue ("RowFirst"));
  gmobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  gmobility.Install (gNodes);


Since gNodes is a single node, there is no need to use GridPositionAllocator.
 
  MobilityHelper mobility;
  mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
                                 "MinX", DoubleValue (0.0),
                                 "MinY", DoubleValue (0.0),
                                 "DeltaX", DoubleValue (2000.0),
                                 "DeltaY", DoubleValue (2000.0),
                                 "GridWidth", UintegerValue (1),
                                 "LayoutType", StringValue ("RowFirst"));
  mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel",
                             "Mode", StringValue ("Distance"),
                             "Distance", StringValue ("1000"),
                             "Speed", StringValue ("ns3::ConstantRandomVariable[Constant=1.0]"),
                             "Bounds", StringValue ("0|200|0|200"));
  mobility.Install (anNodes);

i got this error message after compilation in run time

Creating 2 anNodes.
assert failed. cond="m_bounds.IsInside (position)", file=../src/mobility/model/random-walk-2d-mobility-model.cc, line=168

The message is clear. You are moving outside your designated area because the initial position is outside. 
You placed the (second) node at (0,2000) and you tell it that it can move in the box [0|200|0|200]. 
Reply all
Reply to author
Forward
0 new messages