Bug 1073 - Changing base station position in wimax-multicast has no effect
Changing base station position in wimax-multicast has no effect
Status: NEW
Product: ns-3
Classification: Unclassified
Component: examples
All All
: P5 minor
Assigned To: Flavio Kubota
Depends on:
  Show dependency treegraph
Reported: 2011-03-15 06:09 EDT by Anirudh
Modified: 2011-08-09 16:04 EDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Anirudh 2011-03-15 06:09:35 EDT

I was trying out the wimax-multicast program from the examples/wimax directory and changing the position of the base station seems to have no effect. I later figured this was because a line in the file wimax-multicast.cc calls mobility.Install on both the base station node and the service station nodes. This overrides the mobility information set at the top of the file. 
After commenting out the lines corresponding to mobility.Install the program works fine ie it responds to changes in base station location. 
After I remove the mobility.Install lines, when I set the base station's position to 1000000 instead of 1000, no packets are received because it is out of range which is the correct behaviour.

I have reproduced code snippets below to help isolate the bug:

This is the part where the mobility information is set for base station:
 BSPosition = CreateObject<ConstantPositionMobilityModel> ();

  BSPosition->SetPosition (Vector (1000000, 0, 0));
  bsNodes.Get (0)->AggregateObject (BSPosition);

Here it is set for service stations:

  for (int i = 0; i < nbSS; i++)
      SSPosition[i] = CreateObject<RandomWaypointMobilityModel> ();
      SSPosAllocator[i] = CreateObject<RandomRectanglePositionAllocator> ();
      SSPosAllocator[i]->SetX (UniformVariable ((i / 40) * 2000, (i / 40 + 1) * 2000));
      SSPosAllocator[i]->SetY (UniformVariable ((i / 40) * 2000, (i / 40 + 1) * 2000));
      SSPosition[i]->SetAttribute ("PositionAllocator", PointerValue (SSPosAllocator[i]));
      SSPosition[i]->SetAttribute ("Speed", RandomVariableValue (UniformVariable (10.3, 40.7)));
      SSPosition[i]->SetAttribute ("Pause", RandomVariableValue (ConstantVariable (0.01)));

      ss[i] = ssDevs.Get (i)->GetObject<SubscriberStationNetDevice> ();
      ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM16_12);
      ssNodes.Get (i)->AggregateObject (SSPosition[i]);


And both of these are overridden further down in the code with the lines:

 mobility.Install (bsNodes);

which overrides base station location

  mobility.Install (ssNodes);

 which overrides service station information.

This overriding renders the initial location information irrelevant.