[Ns-developers] 802.11 first changesets to comment on.

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Tue Jan 6 06:45:33 PST 2009


On Tue, 2009-01-06 at 15:12 +0100, Mathieu Lacage wrote:

> > - Added samples/main-propagation-loss.cc, which outputs a plot of all
> > loss models (except Jakes', which I couldnt get to work right or don't
> > understand it.)
> 
> I am trying to look at it right now: did you try setting a non-zero
> doppler frequency ? i.e., 
> 
> DefaultValue::Bind ("ns3::JakesPropagationLossModel::DopplerFreq",
>                     StringValue ("0.1"));

Ok, the problem in your case comes from the fact that the Jakes
propagation model relies on simulation time actually going forward to
calculate the fast fading loss. Since I assume your code is doing a
single loop calling GetLoss repeatedly, the loss is always a constant
equal to the first loss and never changes. The following code gets me
the expected output with the patch from bug 459 applied:

  Ptr<PropagationLossModel> model = CreateObject<JakesPropagationLossModel> ();
  Ptr<MobilityModel> a = CreateObject<StaticMobilityModel> ();
  a->SetPosition (Vector (0.0, 0.0, 0.0));
  Ptr<MobilityModel> b = CreateObject<StaticMobilityModel> ();

  for (double x = 0; x < 2000; x+= 1)
    {
      b->SetPosition (Vector (x, 0.0, 0.0));
      double loss = model->GetLoss (a, b);
      std::cout << x << " " << loss << std::endl;
      Simulator::Stop (Seconds (1.0));
      Simulator::Run ();
    }

regards,
Mathieu



More information about the Ns-developers mailing list