INET Framework for OMNeT++/OMNEST
|
This is the local mobility module of MoBAN. More...
#include <MoBANLocal.h>
Public Member Functions | |
MoBANLocal () | |
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... | |
void | setCoordinator (MoBANCoordinator *coordinator) |
void | setMoBANParameters (Coord referencePoint, double radius, double speed) |
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 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 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 |
Should be redefined in subclasses. More... | |
virtual void | updateVisualRepresentation () override |
Moves the visual representation module's icon to the new position on the screen. More... | |
virtual 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 | emitMobilityStateChangedSignal () |
Emits a signal with the updated mobility state. More... | |
virtual Coord | getRandomPosition () |
Returns a new random position satisfying the constraint area. More... | |
virtual cModule * | findVisualRepresentation () |
Returns the module that represents the object moved by this mobility module. 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 | |
MoBANCoordinator * | coordinator |
The coordinator of the WBAN. More... | |
Coord | referencePosition |
Reference position of the node in the current posture. More... | |
double | radius |
The radius of local mobility of the node in the current posture. More... | |
double | speed |
The speed of local mobility of the node in the current posture. More... | |
double | maxSpeed |
The possible maximum speed at any future time. 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 local mobility module of MoBAN.
It should be instantiated in each node that belongs to a WBAN. The NED parameter "coordinatorIndex" determines to which WBAN (MoBANCoordinator) it belongs. The current implementation uses the Random Walk Mobility Model (RWMM) for individual (local) movement within a sphere around the node, with given speed and sphere radius of the current posture. The reference point of the node in the current posture, the sphere radius, and the speed is given by the corresponding coordinator. RWMM determines the location of the node at any time relative to the given reference point.
inet::MoBANLocal::MoBANLocal | ( | ) |
|
protectedvirtual |
Referenced by initialize().
|
overridevirtual |
Returns the current position at the current simulation time.
Reimplemented from inet::MovingMobilityBase.
|
overridevirtual |
Returns the current speed at the current simulation time.
Reimplemented from inet::MovingMobilityBase.
|
inlineoverridevirtual |
Returns the maximum possible speed at any future time.
Reimplemented from inet::MobilityBase.
|
overrideprotectedvirtual |
Initializes mobility model parameters.
Reimplemented from inet::MovingMobilityBase.
|
inlineoverrideprotectedvirtual |
|
inline |
Referenced by inet::MoBANCoordinator::collectLocalModules().
|
overrideprotectedvirtual |
Initializes the position from the display string or from module parameters.
Reimplemented from inet::MobilityBase.
void inet::MoBANLocal::setMoBANParameters | ( | Coord | referencePoint, |
double | radius, | ||
double | speed | ||
) |
Referenced by inet::MoBANCoordinator::publishToNodes().
|
overrideprotectedvirtual |
Should be redefined in subclasses.
This method gets called when targetPosition and nextChange has been reached, and its task is to set a new targetPosition and nextChange. At the end of the movement sequence, it should set nextChange to -1.
Implements inet::LineSegmentsMobilityBase.
Referenced by setMoBANParameters().
|
overrideprotectedvirtual |
Moves the visual representation module's icon to the new position on the screen.
Reimplemented from inet::MobilityBase.
Referenced by initialize().
|
protected |
The coordinator of the WBAN.
Referenced by computeMaxSpeed(), getCurrentPosition(), getCurrentSpeed(), initialize(), MoBANLocal(), and updateVisualRepresentation().
|
protected |
The possible maximum speed at any future time.
Referenced by computeMaxSpeed(), and MoBANLocal().
|
protected |
The radius of local mobility of the node in the current posture.
Referenced by initialize(), MoBANLocal(), setMoBANParameters(), and setTargetPosition().
|
protected |
Reference position of the node in the current posture.
Referenced by initialize(), MoBANLocal(), setInitialPosition(), setMoBANParameters(), and setTargetPosition().
|
protected |
The speed of local mobility of the node in the current posture.
Referenced by initialize(), MoBANLocal(), setMoBANParameters(), and setTargetPosition().