How to set multiple rng's for the same simulation?

76 views
Skip to first unread message

alanxptm

unread,
Jun 25, 2022, 10:39:48 PM6/25/22
to OMNeT++ Users
I have n nodes, each one sets its own scheduleAt with some random delay, and I also have n routers, each one sets a random delay on sent messages, but all of them get the same values.

I'm trying to make msg transmission random so there are late messages, but everything's concurrent right now. I've made a fake probability buffer which would trap messages for some random times, so it would send them out late. But its not the optimal thing to simulate.

I've read the documentation and some other stuff, but I don't understand what to add in the .ini nor how to use it on my .cc

This is the stuff I have read:

I want to add this in the intRouter and extRouter, while the peer has the scheduleAt

I was trying this, but I couldn't access the peer node and can't tell if it works really. And I'll have some hundreds to thousand nodes so it would be bad to do all of that by hand

[intGroup]
num-rngs=3
**.intRouter[0].rng-0 = 0
**.intRouter[1].rng-1 = 1




model.ned
omnetpp.ini

Alfonso Ariza Quintana

unread,
Jun 27, 2022, 6:22:57 AM6/27/22
to omn...@googlegroups.com
I am not sure what do you want, but if you want to use two different random generators in two different nodes

**.intRouter[0].rng-0 = 0
**.intRouter[1].rng-0 = 1

This is how you need to configure but, if you use the same initial seed for the generator 0 and 1, you will have the exact sequence in both nodes,




De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de alanxptm <alan...@gmail.com>
Enviado: domingo, 26 de junio de 2022 4:39
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] How to set multiple rng's for the same simulation?
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/637a030f-fe9e-456b-b7c6-8ef238c0ba2bn%40googlegroups.com.

alanxptm

unread,
Jun 29, 2022, 11:54:20 AM6/29/22
to OMNeT++ Users
Problem is I'll have n routers, so how do I set and map n seeds? There's one external group with one ext router and s super peers, each super peer has one internal group with one router in it. So I've tried creating n rng's (in this case 2 but it'd be a hundred), seed them, and map them to each router. But doesn't work, I still get the same values everywhere.

[ExtGroup]
num-rngs = 1
seed-0-mt = 99
**.extRouter.rng-0 = 0

[IntGroup]
num-rngs = IntGroup[index]
seed-0-mt = 12534578
seed-1-mt = 945712349
**.intRouter.rng-0 = IntGroup[index]

Alfonso Ariza Quintana

unread,
Jun 29, 2022, 12:17:25 PM6/29/22
to omn...@googlegroups.com
Every time that you call the random generator, the internal seed changes, if you have n routers and everyone calls the random generator, everyone should have a different random value even if all use the same random generator.

The different generators are useful for other tasks, for example, if you want that the sequence of generated packets could be the same always, you can set the source with a particular generator and set the seed of this, now, other random processes (for example, the backoff) won't affect the source sequence, if all use the same generator, a small change in the code (you introduce a new call to the random generator) will change the sequence of the generated packets for the source.


Enviado: miércoles, 29 de junio de 2022 17:54
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] How to set multiple rng's for the same simulation?
 
Reply all
Reply to author
Forward
0 new messages