Change the configuration on the fly

120 views
Skip to first unread message

Daniel F. Pigatto

unread,
Jun 18, 2015, 2:34:53 PM6/18/15
to omn...@googlegroups.com
Hi,

I am quite new with OMNeT adnd MiXiM.

As you all know, I can predefine some configurations for omnetpp.ini file. My question is: can I jump from one configuration to another on the fly? For example, I start my simulation with Configuration A; when my simulation reaches some specific state, I would like to change for configuration B on the fly. Is it possible?

Thank you!

--
Daniel Fernando Pigatto

PhD. Student at ICMC, University of São Paulo (Brazil)
Exchange student at University of the West of England (Bristol, UK)

Michael Kirsche

unread,
Jun 18, 2015, 3:04:50 PM6/18/15
to omn...@googlegroups.com
Hi Daniel,

It's not as easy as that...
The predefined configurations are selected at runtime and you can restart your simulation with a new configuration without recompiling it as you surely know.

If you want to change parameters during the actual simulation runtime, you could implement some logic that (e.g. after checking the current simtime) changes the parameters or you could change your source-code to re-read the parameters every time they are accessed and then try to change them during runtime.

As configurations usually contain information like number of nodes, positions, mobility and traffic patterns, runtime changes often do not make sense while sometimes (changes in the traffic pattern) might make sense. INET applications (for example) contain examples that adapt during runtime or that reflect changed traffic patterns during simulation runtime.

Most of the times, it depends on which type of parameter you want to change during runtime.

Best,
Michael

Daniel F. Pigatto

unread,
Jun 19, 2015, 6:43:09 AM6/19/15
to omn...@googlegroups.com
Hi Michael,

Thank you very much for the detailed answer!

That's exactly what I want to do: change some traffic pattern during simulation; the number of nodes and some physical characteristics would remain the same. I'll check the INET examples to find out which ones change their traffic patterns during the simulation.

Thanks again for helping!

Cheers,
Daniel

Rudolf Hornig

unread,
Jun 22, 2015, 5:09:53 AM6/22/15
to omn...@googlegroups.com, dhan...@gmail.com
The traffic pattern is obviously defined by a volatile parameter so here is pretty easy trick:

**.myInterArrivalTimeParamer = simTime() < 30s ? exponetntial(400ms) : exponential(800ms)

or you can even chain them as ?: operator is evaluated left to right:

**.myInterArrivalTimeParamer = simTime() < 30s ? exponetntial(400ms) : simTime() < 60s ? exponential(800ms) : exponential(2s)

would give exp(400ms) below 30s, exp(800ms) between 30 and 60s and exp(2s) after 60s

Daniel F. Pigatto

unread,
Jun 22, 2015, 6:44:54 PM6/22/15
to omn...@googlegroups.com
Hi Rudolf,

Thank you very much for answering. I've used your example and I'm now understanding better how to do what I need.

Regards,


--
Daniel Fernando Pigatto

PhD. Student at ICMC, University of São Paulo (Brazil)
Exchange student at University of the West of England (Bristol, UK)

--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/3bc5mXaln_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Michael Kirsche

unread,
Jun 23, 2015, 3:37:15 AM6/23/15
to omn...@googlegroups.com
We should maybe collect this on some FAQ... that's a pretty good trick for some use cases!

Rudolf Hornig

unread,
Jun 23, 2015, 5:45:45 AM6/23/15
to omn...@googlegroups.com, michael...@tu-cottbus.de
I was thinking about a FAQ, but I have not figured out how this should be handled and who should curate it? A wiki page, or perhaps pull requests to the main INET site?

Michael Kirsche

unread,
Jun 23, 2015, 6:58:05 AM6/23/15
to omn...@googlegroups.com
I'd be willing to help out in my free time.

Handling it over pull requests to the inet-framework site on Github would be an idea, but some FAQ items are more general or just connected to plain OMNeT.
We could restructure the "old" community content wiki page (https://omnetpp.org/pmwiki/index.php?n=Main.Omnetpp4) into some new sides for the new OMNeT main site.
This goes in the same direction like the collection of tutorials and teaching materials on the INET site, which eventually also contains "plain" OMNeT content.
Shall everything be collected on the INET site or on the OMNeT doc site???

Rudolf Hornig

unread,
Jun 24, 2015, 5:04:06 AM6/24/15
to omn...@googlegroups.com, michael...@tu-cottbus.de
The main OMNeT++ site is joomla based, so it's suitable only if we decide that some pages can be maintained by certain people. (Probably it would be a good idea for a FAQ where some review is desired before anything is published so community editing is not the best solution there).

The other issue is that once we have a resonable amount of content we have to "market" it so newcomers will see it at least once :) The current omnet wiki contains quite an amount of useful stuff but it's buried so deep that nobody reads it. Probably a top level menu entry on the OMNET++ site would do it.

I'm not sure whether we have to have a separate INET and OMNET specific FAQ. 
Should I create a separate top level FAQ page on OMNeT++? I'm not sure we have the resources to keep it tidy, but a few people could maintain that page for the community.

Rudolf Hornig

unread,
Jun 24, 2015, 8:06:58 AM6/24/15
to omn...@googlegroups.com, rudolf...@gmail.com, michael...@tu-cottbus.de
After thinking about it a bit more: I would prefer to post and self answer these questions on stackoverflow. We have an omnet++ and an inet tag there and it is explicitly encouraged to answer your own question as long as it is posted in Q&A form. 


This would allow the community to vote on the best questions and also the best answers and keep the discussion on topic (instead of hijacking a thread like we are doing it now :) )

at the same time we should direct people with such questions towards SO and keep the more general discussion here on the forum/mailing list.

Michael Kirsche

unread,
Jun 24, 2015, 8:12:53 AM6/24/15
to omn...@googlegroups.com
Stackoverflow would eliminate the need to maintain a separate website...
A link or short page with infos about the stackoverflow site and FAQs answered there would be helpful for both the OMNeT and the INET site.

What about the "old community wiki pages"?
General restructuring or extracting the still valid stuff and put them as questions and answers on Stackoverflow?

Thread hijacking is indeed getting out of hand :)
We can discuss this via mail and delete everything after Daniel's answer.
Message has been deleted
Message has been deleted

Alfonso Ariza Quintana

unread,
Jul 30, 2015, 6:20:38 AM7/30/15
to omn...@googlegroups.com

The nodes are created only at the beginning of the simulation, it can’t be change later.

 

There is an alternative that allow to create nodes dynamically in inetmanet, but you can suffer problems with the destination sources,

src/mobility/single/LaptopModelManager.ned

 

This model allows to create and delete the nodes dynamically in the simulations, it can be used for your purposes.

 

 

De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de tas Tk
Enviado el: jueves, 30 de julio de 2015 8:50
Para: OMNeT++ Users <omn...@googlegroups.com>
CC: dhan...@gmail.com
Asunto: [Omnetpp-l] Re: Change the configuration on the fly

 

Hi everyone,

 

I use inetmanet and i have a variable

 

volatile double numHosts;

 

In omnetpp.ini i use  **.numHosts = simTime() < 30s ? 11 : 15

 

but nothing happens, it doesn't add 4 more nodes in the simulation after 30 sec 

 

can anyone help??Am i doing something wrong?

 

Thank you

--
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.

Reply all
Reply to author
Forward
0 new messages