Randomize UE positions for N simulation runs

85 views
Skip to first unread message

praghur

unread,
Mar 25, 2024, 4:31:36 PMMar 25
to 5G-LENA-users
Hello ns3 community. 

I am working on a simulation with 2 gNB, Core Network, and remote host. I have 'x' number of UEs connected per gNB. These UEs are randomly located around the gNBs. I am running this scenario 30 times to calculate the average performance of the communication network. I realized that I am getting the exact same results for all 30 runs of simulation. Please see attached code: main function and grid-scenario-helper to create this scenario. 

I tried to comment out the lines with randomstreams and AssignStreams. But, consecutive simulation runs is still giving me identical results. Can you please suggest what am I missing? Really appreciate any input. Thanks a lot, in advance.
main_func.cc
grid-scenario-helper.cc

Swastik Pal

unread,
Mar 26, 2024, 12:36:09 AMMar 26
to 5G-LENA-users
> These UEs are randomly located around the gNBs.
In your code, no, they are not.

GridScenarioHelper lays out the UEs in, you guessed it, a grid. 

For the scenario you described, you have to create a custom MobilityHelper.

For random positions, here are your options:
  1. Calculate the random positions manually and assign them to UEs.
  2. Pass on a RandomRectanglePositionAllocator, a RandomBoxPositionAllocator or a RandomDiscPositionAllocator to the MobilityHelper.
    https://www.nsnam.org/docs/release/3.40/models/html/mobility.html#positionallocator

Tom Henderson

unread,
Mar 26, 2024, 4:09:53 AMMar 26
to 5g-len...@googlegroups.com
Are you varying the RNG run number for each run?

Please see:
https://www.nsnam.org/docs/release/3.41/manual/html/random-variables.html


On 3/25/24 13:31, 'praghur' via 5G-LENA-users wrote:
> Hello ns3 community.
>
> I am working on a simulation with 2 gNB, Core Network, and remote host.
> I have 'x' number of UEs connected per gNB. These UEs are *randomly*
> located around the gNBs. I am running this scenario 30 times to
> calculate the average performance of the communication network. I
> realized that I am getting the exact same results for all 30 runs of
> simulation. Please see attached code: main function and
> grid-scenario-helper to create this scenario.
>
> I tried to comment out the lines with randomstreams and AssignStreams.
> But, consecutive simulation runs is still giving me identical results.
> Can you please suggest what am I missing? Really appreciate any input.
> Thanks a lot, in advance.
>
> --
> You received this message because you are subscribed to the Google
> Groups "5G-LENA-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to 5g-lena-user...@googlegroups.com
> <mailto:5g-lena-user...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/5g-lena-users/a889ecd1-fa18-4f1c-a4c4-f1758739a065n%40googlegroups.com <https://groups.google.com/d/msgid/5g-lena-users/a889ecd1-fa18-4f1c-a4c4-f1758739a065n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages