#include <MassMobility.h>
Inherits BasicMobility.
Inheritance diagram for MassMobility:
Public Types | |
enum | MassMobilityMsgKinds { MK_CHANGE_DIR = BasicMobility::LAST_BASIC, LAST_MASS } |
The kind field of messages. More... | |
Public Member Functions | |
Module_Class_Members (MassMobility, BasicMobility, 0) | |
virtual void | initialize (int) |
Initializes mobility model parameters. | |
Protected Member Functions | |
virtual void | handleSelfMsg (cMessage *msg) |
Called upon arrival of a self messages. | |
virtual void | makeMove () |
Move the host. | |
virtual void | fixIfHostGetsOutside () |
Should be redefined in subclasses. | |
Protected Attributes | |
cPar * | changeInterval |
cPar * | changeAngleBy |
double | currentSpeed |
speed of the host | |
double | currentAngle |
angle of linear motion | |
Coord | step |
calculated from speed, angle and updateInterval | |
Coord | targetPos |
|
The kind field of messages. that are used internally by this class have one of these values |
|
Should be redefined in subclasses. Should invoke handleIfOutside() and pass the references to the parameters to be modified. Additional action after border handling (such as choosing a new target position if the BorderPolicy is PLACERANDOMLY) should be implemented here.
Reimplemented from BasicMobility. |
|
Called upon arrival of a self messages. The only self message possible is to indicate a new movement. Reimplemented from BasicMobility. |
|
Initializes mobility model parameters. Reads the updateInterval and the velocity If the host is not stationary it calculates a random position and schedules a timer to trigger the first movement Reimplemented from BasicMobility. |
|
Move the host. Move the host if the destination is not reached yet. Otherwise calculate a new random position Reimplemented from BasicMobility. |