INET Framework for OMNeT++/OMNEST
|
This is the coordinator module of the MoBAN mobility model. More...
#include <MoBANCoordinator.h>
Classes | |
struct | pattern |
Data type for one instance of mobility pattern. More... | |
Public Member Functions | |
MoBANCoordinator () | |
~MoBANCoordinator () | |
virtual double | getMaxSpeed () const override |
Returns the maximum possible speed at any future time. More... | |
Public Member Functions inherited from inet::LineSegmentsMobilityBase | |
LineSegmentsMobilityBase () | |
Public Member Functions inherited from inet::MovingMobilityBase | |
virtual Coord | getCurrentPosition () override |
Returns the current position at the current simulation time. More... | |
virtual Coord | getCurrentSpeed () override |
Returns the current speed at the current simulation time. More... | |
virtual EulerAngles | getCurrentAngularPosition () override |
Returns the current angular position at the current simulation time. More... | |
Public Member Functions inherited from inet::MobilityBase | |
virtual EulerAngles | getCurrentAngularSpeed () override |
Returns the current angular speed at the current simulation time. More... | |
virtual Coord | getConstraintAreaMax () const override |
Returns the current angular acceleration at the current simulation time. More... | |
virtual Coord | getConstraintAreaMin () const override |
Public Member Functions inherited from inet::IMobility | |
virtual | ~IMobility () |
Protected Types | |
enum | posture_sel_type { UNIFORM_RANDOM = 0, MARKOV_BASE } |
Possible (supported) strategies for posture selection. More... | |
typedef struct inet::MoBANCoordinator::pattern | Pattern |
Data type for one instance of mobility pattern. More... | |
Protected Member Functions | |
virtual int | numInitStages () const override |
Returns the required number of initialize stages. More... | |
virtual void | initialize (int) override |
Initializes mobility model parameters. More... | |
virtual void | setInitialPosition () override |
Initializes the position from the display string or from module parameters. More... | |
virtual void | setTargetPosition () override |
Set a new target position from the next posture. More... | |
virtual cModule * | findVisualRepresentation () override |
Returns the module that represents the object moved by this mobility module. More... | |
virtual void | finish () override |
To be called at the end of simulation run. More... | |
virtual void | refreshDisplay () const override |
void | selectPosture () |
Function to select the next posture considering the current posture and the Markov model. More... | |
Coord | selectDestination () |
Function to select the destination in the case of a mobile posture. More... | |
double | selectSpeed () |
Select a velocity value within the given velocity range. More... | |
simtime_t | selectDuration () |
Select a stay time duration in the specified range for the new posture. More... | |
bool | isInsideWorld (Coord) |
Checks if all nodes of the WBAN are inside the simulation environment with the given position of the logical center. More... | |
bool | readPostureSpecificationFile () |
Reading the input postures specification file and making the posture data base. More... | |
bool | readConfigurationFile () |
Reads the input configuration file. More... | |
bool | readMobilityPatternFile () |
Reads the previously logged mobility pattern and make mobility pattern data base. More... | |
void | publishToNodes () |
Publishes the reference point and other information of the posture to the blackboard of the belonging nodes. More... | |
void | collectLocalModules (cModule *module) |
Collect MoBAN local modules. More... | |
void | computeMaxSpeed () |
Protected Member Functions inherited from inet::LineSegmentsMobilityBase | |
virtual void | initializePosition () override |
Initializes mobility position. More... | |
virtual void | move () override |
Moves according to the mobility model to the current simulation time. More... | |
Protected Member Functions inherited from inet::MovingMobilityBase | |
MovingMobilityBase () | |
virtual | ~MovingMobilityBase () |
virtual void | handleSelfMessage (cMessage *message) override |
Called upon arrival of a self messages, subclasses must override. More... | |
void | scheduleUpdate () |
Schedules the move timer that will update the mobility state. More... | |
void | moveAndUpdate () |
Moves and notifies listeners. More... | |
Protected Member Functions inherited from inet::MobilityBase | |
MobilityBase () | |
virtual void | checkPosition () |
Checks whether the position is valid or not. More... | |
virtual void | initializeOrientation () |
Initializes the orientation from module parameters. More... | |
virtual void | handleMessage (cMessage *msg) override |
This modules should only receive self-messages. More... | |
virtual void | updateVisualRepresentation () |
Moves the visual representation module's icon to the new position on the screen. More... | |
virtual void | emitMobilityStateChangedSignal () |
Emits a signal with the updated mobility state. More... | |
virtual Coord | getRandomPosition () |
Returns a new random position satisfying the constraint area. More... | |
virtual bool | isOutside () |
Returns true if the mobility is outside of the constraint area. More... | |
virtual void | reflectIfOutside (Coord &targetPosition, Coord &speed, double &angle) |
Utility function to reflect the node if it goes outside the constraint area. More... | |
virtual void | wrapIfOutside (Coord &targetPosition) |
Utility function to wrap the node to the opposite edge (torus) if it goes outside the constraint area. More... | |
virtual void | placeRandomlyIfOutside (Coord &targetPosition) |
Utility function to place the node randomly if it goes outside the constraint area. More... | |
virtual void | raiseErrorIfOutside () |
Utility function to raise an error if the node gets outside the constraint area. More... | |
virtual void | handleIfOutside (BorderPolicy policy, Coord &targetPosition, Coord &speed, double &angle) |
Invokes one of reflectIfOutside(), wrapIfOutside() and placeRandomlyIfOutside(), depending on the given border policy. More... | |
Protected Attributes | |
std::vector< MoBANLocal * > | localModules |
The mobility modules of the nodes in this WBAN. More... | |
double | speed |
Currently selected speed for the mobile posture. More... | |
double | maxSpeed |
The possible maximum speed at any future time. More... | |
FILE * | logfile |
Pointer to the file for logging MoBAN mobility pattern for future use. More... | |
unsigned int | numPostures |
Number of predefined postures. More... | |
std::vector< Posture * > | postureList |
The list of all predefined postures (posture data base) More... | |
Posture * | currentPosture |
The current selected posture. More... | |
simtime_t | minDuration |
The minimum value of the duration for stable postures. More... | |
simtime_t | maxDuration |
The maximum value of the duration for stable postures. More... | |
bool | useMobilityPattern |
Variable that shows if reusing previously logged mobility pattern is requested. More... | |
Pattern * | mobilityPattern |
The mobility pattern data base. More... | |
int | patternLength |
The number of mobility pattern instances which has been read from the input file (length of mobility pattern data base). More... | |
int | currentPattern |
The index of the currently applied mobility pattern from. More... | |
double ** | markovMatrix |
A matrix which maintains the transition probabilities of the Markov Model of posture pattern. More... | |
posture_sel_type | postureSelStrategy |
The requested strategy for posture selection. More... | |
PostureTransition * | transitions |
Class for performing operation for spatial and temporal correlations in posture selection. More... | |
Protected Attributes inherited from inet::LineSegmentsMobilityBase | |
Coord | targetPosition |
End position of current linear movement. More... | |
Protected Attributes inherited from inet::MovingMobilityBase | |
cMessage * | moveTimer |
The message used for mobility state changes. More... | |
simtime_t | updateInterval |
The simulation time interval used to regularly signal mobility state changes. More... | |
bool | stationary |
A mobility model may decide to become stationary at any time. More... | |
Coord | lastSpeed |
The last speed that was reported at lastUpdate. More... | |
simtime_t | lastUpdate |
The simulation time when the mobility state was last updated. More... | |
simtime_t | nextChange |
The next simulation time when the mobility module needs to update its internal state. More... | |
Protected Attributes inherited from inet::MobilityBase | |
cModule * | visualRepresentation |
Pointer to visual representation module, to speed up repeated access. More... | |
const CanvasProjection * | canvasProjection |
The 2D projection used on the canvas. More... | |
Coord | constraintAreaMin |
3 dimensional position and size of the constraint area (in meters). More... | |
Coord | constraintAreaMax |
Coord | lastPosition |
The last position that was reported. More... | |
EulerAngles | lastOrientation |
The last position that was reported. More... | |
Additional Inherited Members | |
Public Types inherited from inet::MobilityBase | |
enum | BorderPolicy { REFLECT, WRAP, PLACERANDOMLY, RAISEERROR } |
Selects how a mobility module should behave if it reaches the edge of the constraint area. More... | |
Static Public Attributes inherited from inet::IMobility | |
static simsignal_t | mobilityStateChangedSignal = cComponent::registerSignal("mobilityStateChanged") |
A signal used to publish mobility state changes. More... | |
This is the coordinator module of the MoBAN mobility model.
It should be instantiated in the top level simulation network, once per WBAN. The coordinator module is the main module that provides the group mobility and correlation between nodes in a WBAN. In the initialization phase, it reads three user defined input files which are the postures specification file, a configuration file which includes all required parameter for specific distributions, and the previously logged mobility pattern, if it is requested to use a logged pattern. Note that all WBAN instances may use the same input files if they are exactly in the same situation.
After the initialization phase, the MoBAN coordinator decides about the posture and the position of the Logical center of the group (WBAN). The absolute position of the reference point of each belonging node is calculated by adding the current position of the logical center by the reference point of that node in the selected posture. The coordinator sets the position of the reference point as well as the speed and the radius of the local movement of nodes.
|
protected |
Data type for one instance of mobility pattern.
|
protected |
Possible (supported) strategies for posture selection.
Enumerator | |
---|---|
UNIFORM_RANDOM | |
MARKOV_BASE |
inet::MoBANCoordinator::MoBANCoordinator | ( | ) |
inet::MoBANCoordinator::~MoBANCoordinator | ( | ) |
|
protected |
Collect MoBAN local modules.
Referenced by initialize().
|
protected |
Referenced by initialize().
|
inlineoverrideprotectedvirtual |
Returns the module that represents the object moved by this mobility module.
Reimplemented from inet::MobilityBase.
|
overrideprotectedvirtual |
To be called at the end of simulation run.
|
inlineoverridevirtual |
Returns the maximum possible speed at any future time.
Reimplemented from inet::MobilityBase.
Referenced by inet::MoBANLocal::computeMaxSpeed().
|
overrideprotectedvirtual |
Initializes mobility model parameters.
Reimplemented from inet::MovingMobilityBase.
|
protected |
Checks if all nodes of the WBAN are inside the simulation environment with the given position of the logical center.
Checks if all nodes of the WBAN are inside the simulation environment with the current position.
Referenced by selectDestination().
|
inlineoverrideprotectedvirtual |
|
protected |
Publishes the reference point and other information of the posture to the blackboard of the belonging nodes.
Referenced by initialize(), and setTargetPosition().
|
protected |
Reads the input configuration file.
Function to read the configuration file which includes the information for configuring and tuning the model for a specific application scenario.
The configuration file can provide the Markov model transition matrices, different area types and time domains, and the proper matrix for each time-space combination. However, these are all optional and will be given just in the case that the space-time correlation are required to be simulated. The function will be called in the initialization phase.
Referenced by initialize().
|
protected |
Reads the previously logged mobility pattern and make mobility pattern data base.
This function reads the input mobility pattern file and make a list of the mobility patterns.
It will be called in the initialization phase if the useMobilityPattern parameter is true.
Referenced by initialize().
|
protected |
Reading the input postures specification file and making the posture data base.
Function to read the specified posture specification input file and make the posture data base.
The posture specification includes the specification of a set of possible body postures in the target application. The specification of each posture should provide the speed range of the global movement of the whole WBAN and the relative position of the reference point, movement radius around the reference point and movement velocity of all nodes in the WBAN. The function will be called in the initialization phase.
Referenced by initialize().
|
overrideprotectedvirtual |
|
protected |
Function to select the destination in the case of a mobile posture.
Select a position inside the simulation area as the destination for the new mobile posture.
It is called whenever a new mobile posture is selected. It is taken into account that all nodes should be inside the area.
Referenced by initialize(), and setTargetPosition().
|
protected |
Select a stay time duration in the specified range for the new posture.
Select a stay time duration in the specified duration range for the new posture.
It is called whenever a new stable posture is selected.
Referenced by setTargetPosition().
|
protected |
Function to select the next posture considering the current posture and the Markov model.
Select a new posture randomly or based on the given Markov model.
If the requested strategy is not uniform random, A Markov chain will be used. If the strategy is INDIVIDUAL_MARKOV, we should retrieve the transition matrix for the current part of the area. If it is INDIVIDUAL_MARKOV, we have the base transition matrix and a steady state vector for the current part of the area. So the closest transition matrix to the base matrix is calculated which satisfies the required steady state vector. In any case, the next posture is selected considering the current posture and according to the final Markov transition matrix.
Referenced by setTargetPosition().
|
protected |
Select a velocity value within the given velocity range.
It is called whenever a new stable posture is selected. In the case of using a logged mobility pattern, the speed value is retrieved from the pattern.
Referenced by setTargetPosition().
|
overrideprotectedvirtual |
Initializes the position from the display string or from module parameters.
Reimplemented from inet::MobilityBase.
|
overrideprotectedvirtual |
Set a new target position from the next posture.
The main process of the MoBAN mobility model.
To be called whenever a destination is reached or the duration of the previous posture expires. It select the behavior of the next movement (the posture and the destination), and prepare the required variables to make the movement. In the case of using a logged mobility pattern, the new posture and other parameters are obtained from the pattern.
Implements inet::LineSegmentsMobilityBase.
|
protected |
The index of the currently applied mobility pattern from.
Referenced by readMobilityPatternFile(), and setTargetPosition().
|
protected |
The current selected posture.
Referenced by isInsideWorld(), publishToNodes(), readConfigurationFile(), refreshDisplay(), selectPosture(), selectSpeed(), and setTargetPosition().
|
protected |
The mobility modules of the nodes in this WBAN.
Referenced by collectLocalModules(), isInsideWorld(), publishToNodes(), and readPostureSpecificationFile().
|
protected |
Pointer to the file for logging MoBAN mobility pattern for future use.
Referenced by finish(), initialize(), and setTargetPosition().
|
protected |
A matrix which maintains the transition probabilities of the Markov Model of posture pattern.
To be given through configuration file.
Referenced by selectPosture().
|
protected |
The maximum value of the duration for stable postures.
Referenced by readConfigurationFile(), and selectDuration().
|
protected |
The possible maximum speed at any future time.
Referenced by computeMaxSpeed().
|
protected |
The minimum value of the duration for stable postures.
Referenced by readConfigurationFile(), and selectDuration().
|
protected |
The mobility pattern data base.
Referenced by computeMaxSpeed(), readMobilityPatternFile(), setTargetPosition(), and ~MoBANCoordinator().
|
protected |
Number of predefined postures.
Referenced by readConfigurationFile(), readPostureSpecificationFile(), and selectPosture().
|
protected |
The number of mobility pattern instances which has been read from the input file (length of mobility pattern data base).
Referenced by computeMaxSpeed(), readMobilityPatternFile(), and setTargetPosition().
|
protected |
The list of all predefined postures (posture data base)
Referenced by computeMaxSpeed(), readConfigurationFile(), readMobilityPatternFile(), readPostureSpecificationFile(), selectPosture(), setTargetPosition(), and ~MoBANCoordinator().
|
protected |
The requested strategy for posture selection.
To be given through configuration file.
Referenced by readConfigurationFile(), and selectPosture().
|
protected |
Currently selected speed for the mobile posture.
Referenced by setTargetPosition().
|
protected |
Class for performing operation for spatial and temporal correlations in posture selection.
Referenced by readConfigurationFile(), selectPosture(), and ~MoBANCoordinator().
|
protected |
Variable that shows if reusing previously logged mobility pattern is requested.
The value is gotten from the parameter of the module
Referenced by computeMaxSpeed(), initialize(), and setTargetPosition().