[Ns-developers] Mobility Node extension

Joseph Kopena tjkopena at cs.drexel.edu
Mon Jun 2 06:21:36 PDT 2008


On Mon, Jun 2, 2008 at 9:08 AM, Hagen Paul Pfeifer <hagen at jauu.net> wrote:
> This patch extend the current logic to that
> affect that particular nodes can be assigned to different
> mobility models. The current behavior is that only instances
> of type NodeContainer can assigned to mobility models.

Hagen,

I don't totally follow the rationale for this patch.  The way to do
this with the current helpers, and the way they were designed to work,
is something like the following.  The idea is to construct topologies
& mobility patterns via unions of sets, building up the scenario out
of subgroups.  If you wanted to install models relatively manually,
you could still add it directly to specific Node objects, and then add
to containers later, or not set mobility on the containers.


NodeContainer groupOne(5);
NodeContainer groupTwo(5);

MobilityHelper static;
static.SetMobilityModel("ns3::StaticMobilityModel", ...)
MobilityHelper mobile;
mobile.SetMobilityModel("ns3::RandomDirection2dMobilityModel", ...)

static.Install(groupOne);
static.Install(groupTwo);

// Could also use NodeContainer::Add() here if group already exists,
// e.g.: groupOne.add(groupTwo);
NodeContainer backbone(groupOne, groupTwo);

// Install networking, etc on backbone

...

-- 
- joe kopena
right here and now


More information about the Ns-developers mailing list