[OMNET][omnet.ini] in .ini file is it possible to iterate overs tuple ? #1109
-
Hello, I'm OMNET beginner, I just looked at the OMNET documentation, but I don't find if there is a way to iterate over tuple. Is there a way to iterate over tuple in order to set position ? Thank you for your help My use case would be something like this [General]
network = MyNetwork
${tuple=(1,2,3), (2,3,4), (3,4,5) }
*.accessPoint.**.initialX = 0m
*.accessPoint.**.initialY = 0m
*.accessPoint.**.initialZ = 0m
*.device.**.initialX = ${tuple[0]}m
*.device.**.initialY = ${tuple[1]}m
*.device.**.initialZ = ${tuple[2]}m .ned file import inet.environment.common.PhysicalEnvironment;
import inet.visualizer.common.IntegratedVisualizer;
import inet.node.inet.WirelessHost;
import inet.node.wireless.AccessPoint;
import inet.networks.base.Ieee80211NetworkBase;
import inet.environment.common.PhysicalEnvironment;
network MyNetwork extends Ieee80211NetworkBase
{
parameters:
@statistic[receptionPower](source="receptionMinSignalPower(radioMedium.signalArrivalStarted)"; record=last);
submodules:
accessPoint: AccessPoint {
@display("p=100,200");
}
device: WirelessHost {
@display("p=100,100");
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
To iterate over positions where x, y, and z coordinates are iterated in lockstep with each other in your OMNeT++ configuration file, you can use the parallel iteration syntax denoted by an exclamation mark (!) followed by the name of another iteration variable. This approach allows you to synchronize multiple iteration variables so that they advance in lockstep, selecting the kth value from each iteration based on the position (iteration count) of the iteration variable specified after the !. For example, if you want to set the initialX, initialY, and initialZ parameters for the device in lockstep, you might define your configuration as follows:
In this configuration, each initialX, initialY, and initialZ parameter for device will be set in lockstep based on the iteration defined by x. For instance, the device in the first run will have its position set to (100m, 100m, 0m), in the second to (200m, 200m, 50m), and so on. |
Beta Was this translation helpful? Give feedback.
To iterate over positions where x, y, and z coordinates are iterated in lockstep with each other in your OMNeT++ configuration file, you can use the parallel iteration syntax denoted by an exclamation mark (!) followed by the name of another iteration variable. This approach allows you to synchronize multiple iteration variables so that they advance in lockstep, selecting the kth value from each iteration based on the position (iteration count) of the iteration variable specified after the !.
For example, if you want to set the initialX, initialY, and initialZ parameters for the device in lockstep, you might define your configuration as follows: