Package: inet.mobility.single
MassMobility
simple moduleThis is a random mobility model for a mobile host with a mass. It is the one used in "Optimized Smooth Handoffs in Mobile IP" by Perkins &Wang.
"An MH moves within the room according to the following pattern. It moves along a straight line for a certain period of time before it makes a turn. This moving period is a random number, normally distributed with average of 5 seconds and standard deviation of 0.1 second. When it makes a turn, the new direction (angle) in which it will move is a normally distributed random number with average equal to the previous direction and standard deviation of 30 degrees. Its speed is also a normally distributed random number, with a controlled average, ranging from 0.1 to 0.45 (unit/sec), and standard deviation of 0.01 (unit/sec). A new such random number is picked as its speed when it makes a turn. This pattern of mobility is intended to model node movement during which the nodes have momentum, and thus do not start, stop, or turn abruptly. When it hits a wall, it reflects off the wall at the same angle; in our simulated world, there is little other choice."
This implementation can be parameterized a bit more, via the changeInterval, changeAngleBy and changeSpeedBy parameters. The parameters described above correspond to the following settings:
- changeInterval = normal(5, 0.1)
- changeAngleBy = normal(0, 30)
- speed = normal(avgSpeed, 0.01)
Author: Emin Ilker Cetinbas, Andras Varga
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Extends
Name | Type | Description |
---|---|---|
MovingMobilityBase | simple module |
Abstract base module for mobility models. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
coordinateSystemModule | string | "" |
module path of the geographic coordinate system module |
visualizeMobility | bool | true |
false means this mobility module does no visualization |
visualRepresentation | string | "^" |
determines the module that is moved by this mobility |
constraintAreaMinX | double | -1m/0 |
min x position of the constraint area, unconstrained by default (negative infinity) |
constraintAreaMinY | double | -1m/0 |
min y position of the constraint area, unconstrained by default (negative infinity) |
constraintAreaMinZ | double | -1m/0 |
min z position of the constraint area, unconstrained by default (negative infinity) |
constraintAreaMaxX | double | 1m/0 |
max x position of the constraint area, unconstrained by default (positive infinity) |
constraintAreaMaxY | double | 1m/0 |
max y position of the constraint area, unconstrained by default (positive infinity) |
constraintAreaMaxZ | double | 1m/0 |
max z position of the constraint area, unconstrained by default (positive infinity) |
updateInterval | double | 0.1s |
the simulation time interval used to regularly signal mobility state changes and update the display |
initialX | double | uniform(constraintAreaMinX, constraintAreaMaxX) | |
initialY | double | uniform(constraintAreaMinY, constraintAreaMaxY) | |
initialZ | double | nanToZero(uniform(constraintAreaMinZ, constraintAreaMaxZ)) | |
startAngle | double | uniform(0deg, 360deg) |
initial angle in degrees |
initFromDisplayString | bool | true | |
changeInterval | double |
frequency of changing speed and angle (can be random) |
|
changeAngleBy | double |
change angle by this much (can be random) |
|
speed | double |
speed (can be random, updated every changeInterval) |
Properties
Name | Value | Description |
---|---|---|
display | i=block/cogwheel | |
class | MassMobility |
Signals
Name | Type | Unit |
---|---|---|
mobilityStateChanged | inet::MobilityBase |
Source code
// // This is a random mobility model for a mobile host with a mass. It is the // one used in "Optimized Smooth Handoffs in Mobile IP" by Perkins &Wang. // // "An MH moves within the room according to the following pattern. It moves // along a straight line for a certain period of time before it makes a turn. // This moving period is a random number, normally distributed with average of // 5 seconds and standard deviation of 0.1 second. When it makes a turn, the // new direction (angle) in which it will move is a normally distributed // random number with average equal to the previous direction and standard // deviation of 30 degrees. Its speed is also a normally distributed random // number, with a controlled average, ranging from 0.1 to 0.45 (unit/sec), and // standard deviation of 0.01 (unit/sec). A new such random number is picked // as its speed when it makes a turn. This pattern of mobility is intended to // model node movement during which the nodes have momentum, and thus do not // start, stop, or turn abruptly. When it hits a wall, it reflects off the // wall at the same angle; in our simulated world, there is little other // choice." // // This implementation can be parameterized a bit more, via the changeInterval, // changeAngleBy and changeSpeedBy parameters. The parameters described above // correspond to the following settings: // - changeInterval = normal(5, 0.1) // - changeAngleBy = normal(0, 30) // - speed = normal(avgSpeed, 0.01) // // @author Emin Ilker Cetinbas, Andras Varga // simple MassMobility extends MovingMobilityBase { parameters: double initialX @unit(m) = default(uniform(constraintAreaMinX, constraintAreaMaxX)); double initialY @unit(m) = default(uniform(constraintAreaMinY, constraintAreaMaxY)); double initialZ @unit(m) = default(nanToZero(uniform(constraintAreaMinZ, constraintAreaMaxZ))); double startAngle @unit(deg) = default(uniform(0deg, 360deg)); // initial angle in degrees bool initFromDisplayString = default(true); volatile double changeInterval @mutable @unit(s); // frequency of changing speed and angle (can be random) volatile double changeAngleBy @mutable @unit(deg); // change angle by this much (can be random) volatile double speed @mutable @unit(mps); // speed (can be random, updated every changeInterval) @class(MassMobility); }File: src/inet/mobility/single/MassMobility.ned