Class to store object position and movement. More...
#include <Move.h>
Inherits BBItem.
Public Member Functions | |
virtual BBItem * | parentObject () const |
Provides BBItem meta information for this class. | |
double | getSpeed () const |
Returns the current speed. | |
void | setSpeed (double speed) |
Sets the current speed in meters per second. | |
const Coord & | getStartPos () const |
Returns the start position. | |
simtime_t | getStartTime () const |
Returns start time, i.e. time point of the start at start position. | |
void | setStart (const Coord &startPos, simtime_t startTime) |
Sets start position (components in meters) and start time. | |
void | setStart (const Coord &startPos) |
Sets start position to passed value (components in meters), start time will be set to current simulation-time. | |
const Coord & | getDirection () const |
Returns the direction vector. | |
void | setDirectionByVector (const Coord &direction) |
Sets the direction to the passed vector, which must be already normalized or the 0-vector. | |
void | setDirectionByTarget (const Coord &target) |
Sets the direction to the normalized vector pointing from the current start position to the passed target point. | |
virtual Coord | getPositionAt (simtime_t actualTime) const |
Returns the position of the Move (Host) at the specified point in time. It is intended to be passed simTime() as actualTime and returns the actual position. | |
std::string | info () const |
Returns information about the current state. | |
Protected Attributes | |
Coord | startPos |
Start position of the host (in meters). | |
simtime_t | startTime |
start time at which host started at startPos | |
Coord | direction |
direction the host is moving to, must be normalized | |
double | speed |
speed of the host in meters per second |
Class to store object position and movement.
Definition at line 42 of file Move.h.
virtual Coord Move::getPositionAt | ( | simtime_t | actualTime | ) | const [inline, virtual] |
Returns the position of the Move (Host) at the specified point in time. It is intended to be passed simTime() as actualTime and returns the actual position.
Assumes that direction represents a normalized vector (length equals 1.0). Further this function does not check whether the given time point is before the startTime of the actual move pattern. So in this case one might obtain an unintended result.
Definition at line 153 of file Move.h.
References FWMath::close(), direction, speed, startPos, and startTime.
Referenced by ChannelAccess::calculatePropagationDelay(), UWBIRStochasticPathlossModel::filterSignal(), UWBIRIEEE802154APathlossModel::filterSignal(), SimplePathlossModel::filterSignal(), and BreakpointPathlossModel::filterSignal().
void Move::setDirectionByTarget | ( | const Coord & | target | ) | [inline] |
Sets the direction to the normalized vector pointing from the current start position to the passed target point.
NOTE: The target point must not be the current start position or too close to it.
Definition at line 135 of file Move.h.
References FWMath::close(), direction, Coord::length(), and startPos.
Referenced by LineSegmentsMobilityBase::beginNextMove(), TractorMobility::calculateXY(), RectangleMobility::calculateXY(), MassMobility::handleSelfMsg(), MassMobility::initialize(), LinearMobility::makeMove(), CircleMobility::makeMove(), and ConstSpeedMobility::setTargetPosition().