34
19
SN.node[2].MobilityManager.updateInterval = 100
SN.node[2].MobilityManager.xCoorDestination = 5
SN.node[2].MobilityManager.yCoorDestination = 100
SN.node[2].MobilityManager.speed = 5
In this configuration, node 2 is the mobile one, instead of node 0, and nodes are much
closer to each other (so that we can simulate interesting interference behaviour).
Yet another configuration section follows with slightly different node locations, which
we do not show here. Instead we draw your attention at the end of the file, where a very short
configuration section resides. Here it is:
[Config varyInterferenceModel]
SN.node[*].Communication.Radio.collisionModel = ${InterfModel=0,1,2}
Notice how we do not assign just one value to the parameter but a series of values. This
is a feature of OMNeT 4.0 and later versions. You can look at the OMNeT manual for a
complete list of the ways you can assign parameters, but the essence of this multiple-value
assignment is that simulation will run many times, each time assigning one of the values. So
given the example above we will run the simulation 3 times. The name “InterfModel”
in the
curly braces will just be used as a label in the output produced and helps us parse the output
more easily.
If you have more than one parameter that takes multiple values, then all combinations
will be run. In the example below we have 2 parameters taking 3 values each, which means 9
possible parameter combinations, thus 9 simulation runs.
SN.node[1].Communication.Radio.TxOutputPower = ${TxPower="-5dBm", "-10dBm", "-15dBm"}
SN.node[0].Communication.Radio.CCAthreshold = ${CCAthreshold=-95, -90, -85}
You can even do more complicated things such as putting constraints, so that not all
possible combinations are
executed. Here‟s an example from
BANtest/omnetpp.ini
:
SN.node[*].Communication.MAC.scheduledAccessLength = ${schedSlots=6,5,4,3}
SN.node[*].Communication.MAC.RAP1Length = ${RAPslots=2,7,12,17}
constraint = $schedSlots * 5 + $RAPslots == 32
The example above will only execute 4 combinations: (6,2), (5,7), (4,12), (3,17).