randomwalk2dmobility model

5 views
Skip to first unread message

Binus, Newuleko Bayo (The grey)

unread,
Sep 29, 2025, 8:10:51 PM (yesterday) Sep 29
to ns-3-users
hi, please i have a problem. i am using the randomwalk2dmobility model. but my simulation area is circular. My concern is that the boundary is set in rectangle while the simulation area is in a circle. how do i deal with this situation?
here is my code snippet: 

MobilityHelper mobilityMobile;
    mobilityMobile.SetPositionAllocator("ns3::UniformDiscPositionAllocator",
                                        "rho",
                                        DoubleValue(radiusMeters),
                                        "X",
                                        DoubleValue(0.0),
                                        "Y",
                                        DoubleValue(0.0));
    mobilityMobile.SetMobilityModel(
        "ns3::RandomWalk2dMobilityModel",
        "Speed",
        StringValue("ns3::UniformRandomVariable[Min=2.0|Max=5.0]"),
        "Bounds",
        RectangleValue(Rectangle(-radiusMeters, radiusMeters, -radiusMeters, radiusMeters)));

Tommaso Pecorella

unread,
3:09 PM (8 hours ago) 3:09 PM
to ns-3-users
I'm afraid you'll need to develop a new RandomWalk model.
The good news is that it's not that complicated, just look at the existing ones.

Reply all
Reply to author
Forward
0 new messages