real time input variation

15 views
Skip to first unread message

Alexandre DESTRUEL

unread,
Jul 14, 2009, 7:01:31 AM7/14/09
to omn...@googlegroups.com
Hello all,

I look for a solution to change input paramete value on real time like a dimmer. Does it's possible to create it (programme it)?
regards
alex

Rudolf Hornig

unread,
Jul 14, 2009, 8:19:50 AM7/14/09
to omn...@googlegroups.com
Create a simple module that receives some input from the outside world (i.e. real time) and it can set any parameter values in the model. Be sure to specify the parameter to be volatile.

Alexandre DESTRUEL

unread,
Jul 14, 2009, 9:15:12 AM7/14/09
to omn...@googlegroups.com
Hy Rudolf,

I don't understand what you mean about outside world.
I want hust to change some value (ie: bit length) on my programm dynamically instead of stop de program to change the value. 

2009/7/14 Rudolf Hornig <rudolf...@gmail.com>

Harald Weillechner

unread,
Jul 14, 2009, 9:40:56 AM7/14/09
to omn...@googlegroups.com
@rudolf:
volatile: where do you specify the volatile parameter, in the ned file
- in the module definition?? As I have seen it is a new feature in
Omnetpp++4. So how can I handle such scenario with Omnet3.3?

@Alexandre
In which situation do you want to change the parameter? Do you want to
change the parameter by hand or automatically by time or something
else?
Maybe it would be helpful if you would explain your problem.

Greetings

2009/7/14 Alexandre DESTRUEL <alexandre...@gmail.com>:

Alexandre DESTRUEL

unread,
Jul 14, 2009, 9:46:32 AM7/14/09
to omn...@googlegroups.com
I want to change the parameter (bit length) by hand  to evaluate the network performances but dynamically without stopped my program.


2009/7/14 Harald Weillechner <haraldwe...@gmail.com>

Rudolf Hornig

unread,
Jul 14, 2009, 10:53:43 AM7/14/09
to omn...@googlegroups.com
On Tue, Jul 14, 2009 at 3:40 PM, Harald Weillechner <haraldwe...@gmail.com> wrote:

@rudolf:
volatile: where do you specify the volatile parameter, in the ned file
- in the module definition?? As I have seen it is a new feature in
Omnetpp++4. So how can I handle such scenario with Omnet3.3?

In omnet 3.3. every parameter is "volatile" by default (unless you specify the const) keyword.
i.e. in 3.3:
  numeric length;
in 4.0:
  volatile int length;

 

Rudolf Hornig

unread,
Jul 14, 2009, 11:04:42 AM7/14/09
to omn...@googlegroups.com
On Tue, Jul 14, 2009 at 3:46 PM, Alexandre DESTRUEL <alexandre...@gmail.com> wrote:
I want to change the parameter (bit length) by hand  to evaluate the network performances but dynamically without stopped my program.

I'm not sure this is a good idea. Usually the thing goes like:
set the specific parameter in ini file. Run a whole simulation. Analyse the result.
If you want to try the with several values, OMNeT++ can itearte over different values, and run the sim and generate values for each value. This is a recommended way, because it is repeatable.


If you want to experiment just by hand (by changing the value on the fly) (higly unrecommended ):
- be sure to define the prameter as volatile (or be sure not to specify the const keyword in omnet 3.3.)
- be sure that you do not cache the parameter value in your module (i.e. you SHOULD not read the
  parameter value in the initialize method, and store it in a member variable, buit rather you should
  read the parameter each time you need it (param("length"));
- if the above are true:
  - you can safely go into TK-env object inspector find the object you want to change and change the perameter in the inspector. The next time your simulation requests the parameter value it will read the value you have provided.
  - beware the you can change values ONLY for a single object. i.e. you cannot easily change the length parameter for all hosts, messages or whetever you want to change. you must find and change EACH object by hand.

Rudolf


 
Reply all
Reply to author
Forward
0 new messages