This example shows how to use AnalogueModels.
It contains the following modules/classes:
RandomFreqTimeModel: An AnalogueModel implementation which defines random attunation values in time and frequency using the MultiDimMapping.
RandomFrequencyOnlyModel: An AnalogueModel implementation which defines random attenuation values in the frequency domain by using the MultiDimMapping class. Since every mapping represented by the Mapping interface of MiXiM has to be defined over time this shows how to "simulate" mappings which arent't defined over time.
ThresholdDecider: A quick and dirty implementation of a very verbose Decider. It is only used for a better illustration of how the AnalogueModels affect the signal during runtime and shouldn't be used as a template for an actual Decider.
SamplePhyLayer: A PhyLayer subclass which knows how to initialize our own AnalogueModels and Decider.
SimpleMacLayer: A very basic implementation of a Mac layer without using the actual BaseMacLayer. This is only to keep the example independent from the BaseMacLayer, normally you whould just use the BaseMacLayer.
The network itself consists of only two host which keep ping-pong-ing messages between each other.
The simulation has the following run configurations:
See the comments in the source for more details.
The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.
| Name | Type | Default value | Description |
|---|---|---|---|
| playgroundSizeX | double |
x size of the area the nodes are in (in meters) |
|
| playgroundSizeY | double |
y size of the area the nodes are in (in meters) |
|
| playgroundSizeZ | double |
z size of the area the nodes are in (in meters) |
|
| numHosts | double |
total number of hosts in the network |
| Name | Value | Description |
|---|---|---|
| isNetwork | ||
| display | bgb=$playgroundSizeX,$playgroundSizeY,white,,;bgp=10,50 |
| Name | Type | Default value | Description |
|---|---|---|---|
| world.coreDebug | bool |
debug switch for the base framework |
|
| world.useTorus | bool |
use the playground as torus? |
|
| world.use2D | bool |
use a 2-dimensional world? |
|
| connectionManager.coreDebug | bool |
debug switch for core framework |
|
| connectionManager.sendDirect | bool |
send directly to the node or create separate gates for every connection |
|
| connectionManager.pMax | double |
maximum sending power used for this network [mW] |
|
| connectionManager.sat | double |
minimum signal attenuation threshold [dBm] |
|
| connectionManager.alpha | double |
minimum path loss coefficient |
|
| connectionManager.carrierFrequency | double |
minimum carrier frequency of the channel [Hz] |
|
| connectionManager.drawMaxIntfDist | bool | false |
should the maximum interference distance be displayed for each node? |
| node.utility.coreDebug | bool |
debug switch for the base framework |
|
| node.mobility.coreDebug | bool |
debug switch for the core framework |
|
| node.mobility.x | double |
x coordinate of the nodes' position (-1 = random) |
|
| node.mobility.y | double |
y coordinate of the nodes' position (-1 = random) |
|
| node.mobility.z | double |
z coordinate of the nodes' position (-1 = random) |
|
| node.nic.phy.coreDebug | bool |
debug switch for core framework |
|
| node.nic.phy.recordStats | bool | false |
enable/disable tracking of statistics (eg. cOutvectors) |
| node.nic.phy.headerLength | int | 0 |
defines the length of the phy header (/preamble) |
| node.nic.phy.usePropagationDelay | bool |
Should transmission delay be simulated? |
|
| node.nic.phy.thermalNoise | double |
the strength of the thermal noise [dBm] |
|
| node.nic.phy.useThermalNoise | bool |
should thermal noise be considered? |
|
| node.nic.phy.analogueModels | xml |
Specification of the analogue models to use and their parameters |
|
| node.nic.phy.decider | xml |
Specification of the decider to use and its parameters |
|
| node.nic.phy.sensitivity | double |
The sensitivity of the physical layer [dBm] |
|
| node.nic.phy.maxTXPower | double |
The maximum transimission power of the physical layer [mW] |
|
| node.nic.phy.timeRXToTX | double | 0 |
switchTimes [s]: |
| node.nic.phy.timeRXToSleep | double | 0 | |
| node.nic.phy.timeTXToRX | double | 0 | |
| node.nic.phy.timeTXToSleep | double | 0 | |
| node.nic.phy.timeSleepToRX | double | 0 | |
| node.nic.phy.timeSleepToTX | double | 0 | |
| node.nic.phy.initialRadioState | int | 0 |
state the radio is initially in |
| node.nic.phy.radioMinAtt | double | 1.0 |
radios gain factor (attenuation) while receiving |
| node.nic.phy.radioMaxAtt | double | 0.0 |
radios gain factor (attenuation) while not receiving |
| node.nic.phy.nbRadioChannels | int | 1 |
Number of available radio channels. Defaults to single channel radio. |
| node.nic.phy.initialRadioChannel | int | 0 |
Initial radio channel. |
// //This example shows how to use AnalogueModels. // //It contains the following modules/classes: // //RandomFreqTimeModel: //An AnalogueModel implementation which defines random attunation values //in time and frequency using the MultiDimMapping. // //RandomFrequencyOnlyModel: //An AnalogueModel implementation which defines random attenuation values //in the frequency domain by using the MultiDimMapping class. //Since every mapping represented by the Mapping interface of MiXiM has to be //defined over time this shows how to "simulate" mappings which arent't //defined over time. // //ThresholdDecider: //A quick and dirty implementation of a very verbose Decider. It is only //used for a better illustration of how the AnalogueModels affect the signal //during runtime and shouldn't be used as a template for an actual Decider. // //SamplePhyLayer: //A PhyLayer subclass which knows how to initialize our own AnalogueModels //and Decider. // //SimpleMacLayer: //A very basic implementation of a Mac layer without using the actual //BaseMacLayer. This is only to keep the example independent from the //BaseMacLayer, normally you whould just use the BaseMacLayer. // // //The network itself consists of only two host which keep ping-pong-ing //messages between each other. // //The simulation has the following run configurations: // //- "General" - infinite ping-pong-ing without simulation of propagation delay //- "WithPropDelay" - same with simulation of propagation delay //- "PerfTest" - meant to be used when called with CmdEnv for some performance // testing (time limited) // // //See the comments in the source for more details. // network AnalogueModels { parameters: double playgroundSizeX @unit(m); // x size of the area the nodes are in (in meters) double playgroundSizeY @unit(m); // y size of the area the nodes are in (in meters) double playgroundSizeZ @unit(m); // z size of the area the nodes are in (in meters) double numHosts; // total number of hosts in the network @display("bgb=$playgroundSizeX,$playgroundSizeY,white,,;bgp=10,50"); submodules: world: BaseWorldUtility { parameters: playgroundSizeX = playgroundSizeX; playgroundSizeY = playgroundSizeY; playgroundSizeZ = playgroundSizeZ; @display("p=100,0;i=misc/globe"); } connectionManager: ConnectionManager { parameters: @display("p=200,0;b=42,42,rect,red,,;i=abstract/multicast"); } node[numHosts]: PhyMacHost { parameters: numHosts = numHosts; @display("p=50,50;b=42,42,rect,red,,;i=device/wifilaptop"); } connections allowunconnected: // all connections and gates are to be generated dynamically }