INET Framework for OMNeT++/OMNEST
|
#include <RotatingMobilityBase.h>
Public Member Functions | |
virtual EulerAngles | getCurrentAngularPosition () override |
Returns the current angular position at the current simulation time. More... | |
virtual EulerAngles | getCurrentAngularSpeed () override |
Returns the current angular speed at the current simulation time. More... | |
Public Member Functions inherited from inet::MobilityBase | |
virtual double | getMaxSpeed () const override |
Returns the maximum possible speed at any future 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 () |
virtual Coord | getCurrentPosition ()=0 |
Returns the current position at the current simulation time. More... | |
virtual Coord | getCurrentSpeed ()=0 |
Returns the current speed at the current simulation time. More... | |
Protected Member Functions | |
RotatingMobilityBase () | |
virtual | ~RotatingMobilityBase () |
virtual void | initialize (int stage) override |
Initializes mobility model parameters. More... | |
virtual void | initializeOrientation () override |
Initializes the orientation from module parameters. More... | |
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 | rotateAndUpdate () |
Moves and notifies listeners. More... | |
virtual void | rotate ()=0 |
Moves according to the mobility model to the current simulation time. More... | |
Protected Member Functions inherited from inet::MobilityBase | |
MobilityBase () | |
virtual int | numInitStages () const override |
Returns the required number of initialize stages. More... | |
virtual void | initializePosition () |
Initializes mobility position. More... | |
virtual void | setInitialPosition () |
Initializes the position from the display string or from module parameters. More... | |
virtual void | checkPosition () |
Checks whether the position is valid or not. 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 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 | |
cMessage * | rotateTimer |
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... | |
EulerAngles | lastAngularSpeed |
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... | |
|
protected |
|
protectedvirtual |
|
overridevirtual |
Returns the current angular position at the current simulation time.
Reimplemented from inet::MobilityBase.
|
overridevirtual |
Returns the current angular speed at the current simulation time.
Reimplemented from inet::MobilityBase.
|
overrideprotectedvirtual |
Called upon arrival of a self messages, subclasses must override.
Implements inet::MobilityBase.
|
overrideprotectedvirtual |
Initializes mobility model parameters.
Reimplemented from inet::MobilityBase.
|
overrideprotectedvirtual |
Initializes the orientation from module parameters.
Reimplemented from inet::MobilityBase.
Reimplemented in inet::LinearRotatingMobilityBase.
|
protectedpure virtual |
Moves according to the mobility model to the current simulation time.
Subclasses must override and update lastPosition, lastSpeed, lastUpdate, nextChange and other state according to the mobility model.
Implemented in inet::LinearRotatingMobilityBase.
Referenced by rotateAndUpdate().
|
protected |
Moves and notifies listeners.
Referenced by getCurrentAngularPosition(), getCurrentAngularSpeed(), and handleSelfMessage().
|
protected |
Schedules the move timer that will update the mobility state.
Referenced by handleSelfMessage(), inet::LinearRotatingMobilityBase::initializeOrientation(), and initializeOrientation().
|
protected |
The last speed that was reported at lastUpdate.
Referenced by getCurrentAngularSpeed().
|
protected |
The simulation time when the mobility state was last updated.
Referenced by inet::LinearRotatingMobilityBase::initializeOrientation(), initializeOrientation(), inet::LinearRotatingMobilityBase::rotate(), rotateAndUpdate(), and RotatingMobilityBase().
|
protected |
The next simulation time when the mobility module needs to update its internal state.
The -1 value turns off sending a self message for the next mobility state change.
Referenced by inet::LinearRotatingMobilityBase::initializeOrientation(), inet::LinearRotatingMobilityBase::rotate(), rotateAndUpdate(), RotatingMobilityBase(), and scheduleUpdate().
|
protected |
The message used for mobility state changes.
Referenced by initialize(), RotatingMobilityBase(), scheduleUpdate(), and ~RotatingMobilityBase().
|
protected |
A mobility model may decide to become stationary at any time.
The true value disables sending self messages.
Referenced by inet::LinearRotatingMobilityBase::initializeOrientation(), RotatingMobilityBase(), and scheduleUpdate().
|
protected |
The simulation time interval used to regularly signal mobility state changes.
The 0 value turns off the signal.
Referenced by initialize(), RotatingMobilityBase(), and scheduleUpdate().