VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes
DtMoveAlongRouteTimeEstimator Class Reference

Performs time estimates for move along route with actions tasks. More...

Classes

struct  InputRoute
 Structure for storing inputs describing the route to be followed and any actions to be taken while moving along it. More...
 
struct  OutputEstimates
 

Public Types

typedef void(* TaskCallbackFcn )(DtSimTask *task, const DtVertexList &vertices, double position, void *usr)
 
typedef void(* SetCallbackFcn )(DtSetDataRequest *set, const DtVertexList &vertices, double position, void *usr)
 

Public Member Functions

 DtMoveAlongRouteTimeEstimator ()
 
virtual ~DtMoveAlongRouteTimeEstimator ()
 
virtual void initialize ()
 Initializes the estimator by registering default task and set pre-processor and processor functions. More...
 
virtual void estimateTimes (const InputRoute &routeInput, OutputEstimates &estimates)
 Estimates the ETA at every vertex and action point along a route. More...
 
virtual void setInitialGeocentricLocation (const DtVector &geocLoc)
 Sets the initial geocentric location. More...
 
virtual void setInitialTime (double t)
 Sets the initial time, in seconds. More...
 
virtual void setInitialSpeed (double s)
 Sets the initial speed, in meters per second. Should be called prior to any time estimates. More...
 
virtual void setEntityMaxSpeed (double speed)
 Initializes the entity's absolute maximum speed. More...
 
virtual double entityMaxSpeed () const
 The entity's absolute maximum speed. More...
 
virtual void setEntityMinSpeed (double speed)
 Initializes the entity's absolute minimum speed. More...
 
virtual double entityMinSpeed () const
 The entity's absolute minimum speed. More...
 
virtual void setEntityDefaultSpeed (double speed)
 Initializes the entity's default speed. More...
 
virtual double entityDefaultSpeed () const
 The entity's default speed. More...
 
virtual void setEntityMaxAcceleration (double accel)
 Initializes the entity's maximum acceleration. More...
 
virtual double entityMaxAcceleration () const
 The entity's default speed. More...
 
virtual void setEntityMaxDeceleration (double decel)
 Initializes the entity's maximum deceleration. More...
 
virtual double entityMaxDeceleration () const
 The entity's default speed. More...
 
virtual void setCurrentGeocentricLocation (const DtVector &geocLoc)
 Sets the current geocentric location. More...
 
virtual DtVector currentGeocentricLocation () const
 The current preferred speed. More...
 
virtual void setCurrentTime (double t)
 Sets the current time, in seconds. More...
 
virtual double currentTime () const
 The current time. More...
 
virtual void setCurrentMinSpeed (double speed)
 Sets the current minimum speed. More...
 
virtual double currentMinSpeed () const
 The current minimum speed. More...
 
virtual void setCurrentMaxSpeed (double speed)
 Sets the current maximum speed. More...
 
virtual double currentMaxSpeed () const
 The current maximum speed. More...
 
virtual void setCurrentPreferredSpeed (double speed)
 Sets the current preferred speed. More...
 
virtual double currentPreferredSpeed () const
 The current preferred speed. More...
 
virtual void setCurrentSpeed (double speed)
 Sets the current speed. More...
 
virtual double currentSpeed () const
 The current speed. More...
 
virtual void setCurrentAcceleration (double speed)
 Sets the current acceleration. More...
 
virtual double currentAcceleration () const
 The current acceleration. More...
 
virtual double targetPosition () const
 Returns the target position along the route. More...
 
virtual double targetTime () const
 Returns the time at which we should arrive at the target position. More...
 
virtual double holdPosition () const
 Returns the hold position along the route. More...
 
virtual void addTaskPreprocessor (DtSimTaskMessageType t, TaskCallbackFcn fcn, void *usr)
 Adds a task pre-processor callback. More...
 
virtual void addTaskProcessor (DtSimTaskMessageType t, TaskCallbackFcn fcn, void *usr)
 Adds a task processor callback. More...
 
virtual void addSetPreprocessor (DtSetMessageType t, SetCallbackFcn fcn, void *usr)
 Adds a set pre-processor callback. More...
 
virtual void addSetProcessor (DtSetMessageType t, SetCallbackFcn fcn, void *usr)
 Adds a set processor callback. More...
 
virtual void printState (std::ostream &strm) const
 Prints the current state to the specified output stream. More...
 

Static Public Member Functions

static
DtMoveAlongRouteTimeEstimator
createAndInitialize ()
 Creates and initializes a new estimator. More...
 

Static Public Attributes

static const double NoTimeSpecified
 
static const double NoRoutePositionSpecified
 

Protected Types

typedef std::pair
< TaskCallbackFcn, void * > 
TaskCallbackPair
 
typedef std::map
< DtSimTaskMessageType,
TaskCallbackPair
TaskCallbackMap
 
typedef std::pair
< SetCallbackFcn, void * > 
SetCallbackPair
 
typedef std::map
< DtSetMessageType,
SetCallbackPair
SetCallbackMap
 

Protected Member Functions

virtual DtVector calculateLocationOfPositionOnRoute (double pos, const DtVertexList &vertices) const
 Calculates the geocentric location of a point on a route. More...
 
virtual double calculateTravelTime (const DtVector &currLoc, const DtVector &nextLoc, double currentSpeed, double preferredSpeed, double &newSpeed, double &newAcceleration) const
 Calculates the time to get from one location to the next given current settings and specified entity capabilities. More...
 
virtual double calculatesDistanceToTarget (const DtVector &currLoc, double currPos, const DtVertexList &vertices, double targetPos) const
 Calculates an estimated distance to the target position. More...
 
void sanityCheckCurrentSettings ()
 Performs a sanity check on current settings and adjusts some of the current values to ensure correctness before beginning estimates. More...
 
virtual void processHold (const DtVertexList &vertices, double position)
 Performs a hold at the specified position, determining hold time based on desired time arrival time. More...
 
void preprocessAction (const DtRouteAction &action, const DtVertexList &vertices, double position)
 Pre-process the given action. Calls preprocessTask() or preprocessSet() accordingly. More...
 
void processAction (const DtRouteAction &action, const DtVertexList &vertices, double position)
 Process the given action. Calls processTask() or processSet() accordingly. More...
 
void preprocessTask (DtSimTask *task, const DtVertexList &vertices, double position)
 Pre-processes the given task. More...
 
void preprocessSet (DtSetDataRequest *set, const DtVertexList &vertices, double position)
 Pre-processes the given set. More...
 
void processTask (DtSimTask *task, const DtVertexList &vertices, double position)
 Processes the given task. More...
 
void processSet (DtSetDataRequest *set, const DtVertexList &vertices, double position)
 Processes the given set. More...
 

Protected Attributes

double myHoldPosition
 Position at which to hold. More...
 
TaskCallbackMap myTaskPreprocessors
 
TaskCallbackMap myTaskProcessors
 
SetCallbackMap mySetPreprocessors
 
SetCallbackMap mySetProcessors
 
Coordinate_SystemmyCoordSys
 
double myCurrentTime
 Current state, initialized by user and updated by calculations. More...
 
DtVector myCurrentLocation
 
double myTargetPosition
 Target position and the time at which we need to arrive there. More...
 
double myTargetTime
 
double myEntityMinSpeed
 Entity characteristics, initialized by user. More...
 
double myEntityMaxSpeed
 
double myEntityDefaultSpeed
 
double myEntityMaxAcceleration
 
double myEntityMaxDeceleration
 
double myCurrentMinSpeed
 Temporary preferences, updated by some actions during calculations. More...
 
double myCurrentMaxSpeed
 
double myCurrentPreferredSpeed
 
double myCurrentSpeed
 Current state, updated by calculations. More...
 
double myCurrentAcceleration
 

Detailed Description

Performs time estimates for move along route with actions tasks.

Based on settings for the entity's speed and acceleration characteristics, determines an estimate of when the entity will reach each vertex and task and set along the route. Before calling any estimation functions you will need to initialize the estimator with the current state and characteristics of the entity. To initialize the estimator for a particular entity, it is recommended you call the following setEntity* functions.

Member Typedef Documentation

typedef void(* DtMoveAlongRouteTimeEstimator::TaskCallbackFcn)(DtSimTask *task, const DtVertexList &vertices, double position, void *usr)
typedef void(* DtMoveAlongRouteTimeEstimator::SetCallbackFcn)(DtSetDataRequest *set, const DtVertexList &vertices, double position, void *usr)

Constructor & Destructor Documentation

DtMoveAlongRouteTimeEstimator::DtMoveAlongRouteTimeEstimator ( )
virtual DtMoveAlongRouteTimeEstimator::~DtMoveAlongRouteTimeEstimator ( )
virtual

Member Function Documentation

virtual void DtMoveAlongRouteTimeEstimator::initialize ( )
virtual

Initializes the estimator by registering default task and set pre-processor and processor functions.

virtual void DtMoveAlongRouteTimeEstimator::estimateTimes ( const InputRoute routeInput,
OutputEstimates estimates 
)
virtual

Estimates the ETA at every vertex and action point along a route.

Parameters
vertexEtas- Input parameter describing the route and any actions to take along it.
actionEtas- Output parameter that specifies estimated times for each route vertex and action.
virtual void DtMoveAlongRouteTimeEstimator::setInitialGeocentricLocation ( const DtVector geocLoc)
virtual

Sets the initial geocentric location.

Should be called prior to any time estimates. If not called, the first route vertex is assumed to be the initial position.

virtual void DtMoveAlongRouteTimeEstimator::setInitialTime ( double  t)
virtual

Sets the initial time, in seconds.

Should be called prior to any time estimates. The meaning of the value, other than that it is in seconds, is up to the caller. It can be relative to any time frame of the caller's choosing. Default is 0.0.

virtual void DtMoveAlongRouteTimeEstimator::setInitialSpeed ( double  s)
virtual

Sets the initial speed, in meters per second. Should be called prior to any time estimates.

virtual void DtMoveAlongRouteTimeEstimator::setEntityMaxSpeed ( double  speed)
virtual

Initializes the entity's absolute maximum speed.

Should be initialized once and not changed by any calculations.

virtual double DtMoveAlongRouteTimeEstimator::entityMaxSpeed ( ) const
virtual

The entity's absolute maximum speed.

virtual void DtMoveAlongRouteTimeEstimator::setEntityMinSpeed ( double  speed)
virtual

Initializes the entity's absolute minimum speed.

Should be initialized once and not changed by any calculations.

virtual double DtMoveAlongRouteTimeEstimator::entityMinSpeed ( ) const
virtual

The entity's absolute minimum speed.

virtual void DtMoveAlongRouteTimeEstimator::setEntityDefaultSpeed ( double  speed)
virtual

Initializes the entity's default speed.

Should be initialized once and not changed by any calculations.

virtual double DtMoveAlongRouteTimeEstimator::entityDefaultSpeed ( ) const
virtual

The entity's default speed.

virtual void DtMoveAlongRouteTimeEstimator::setEntityMaxAcceleration ( double  accel)
virtual

Initializes the entity's maximum acceleration.

Should be initialized once and not changed by any calculations.

virtual double DtMoveAlongRouteTimeEstimator::entityMaxAcceleration ( ) const
virtual

The entity's default speed.

virtual void DtMoveAlongRouteTimeEstimator::setEntityMaxDeceleration ( double  decel)
virtual

Initializes the entity's maximum deceleration.

Should be initialized once and not changed by any calculations.

virtual double DtMoveAlongRouteTimeEstimator::entityMaxDeceleration ( ) const
virtual

The entity's default speed.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentGeocentricLocation ( const DtVector geocLoc)
virtual

Sets the current geocentric location.

Called by calculations to adjust location as travel along the route is estimated.

virtual DtVector DtMoveAlongRouteTimeEstimator::currentGeocentricLocation ( ) const
virtual

The current preferred speed.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentTime ( double  t)
virtual

Sets the current time, in seconds.

Called by calculations to adjust elapsed time as travel along the route is estimated.

virtual double DtMoveAlongRouteTimeEstimator::currentTime ( ) const
virtual

The current time.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentMinSpeed ( double  speed)
virtual

Sets the current minimum speed.

May be called by calculations to adjust the minimum speed based on entity actions.

virtual double DtMoveAlongRouteTimeEstimator::currentMinSpeed ( ) const
virtual

The current minimum speed.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentMaxSpeed ( double  speed)
virtual

Sets the current maximum speed.

May be called by calculations to adjust the maximum speed based on entity actions.

virtual double DtMoveAlongRouteTimeEstimator::currentMaxSpeed ( ) const
virtual

The current maximum speed.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentPreferredSpeed ( double  speed)
virtual

Sets the current preferred speed.

May be called by calculations to adjust the maximum speed based on entity actions.

virtual double DtMoveAlongRouteTimeEstimator::currentPreferredSpeed ( ) const
virtual

The current preferred speed.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentSpeed ( double  speed)
virtual

Sets the current speed.

Updated by calculations to adjust speed. Should not be called directly by users!

virtual double DtMoveAlongRouteTimeEstimator::currentSpeed ( ) const
virtual

The current speed.

virtual void DtMoveAlongRouteTimeEstimator::setCurrentAcceleration ( double  speed)
virtual

Sets the current acceleration.

Updated by calculations to adjust acceleration. Should not be called directly by users!

virtual double DtMoveAlongRouteTimeEstimator::currentAcceleration ( ) const
virtual

The current acceleration.

virtual double DtMoveAlongRouteTimeEstimator::targetPosition ( ) const
virtual

Returns the target position along the route.

virtual double DtMoveAlongRouteTimeEstimator::targetTime ( ) const
virtual

Returns the time at which we should arrive at the target position.

virtual double DtMoveAlongRouteTimeEstimator::holdPosition ( ) const
virtual

Returns the hold position along the route.

virtual void DtMoveAlongRouteTimeEstimator::addTaskPreprocessor ( DtSimTaskMessageType  t,
TaskCallbackFcn  fcn,
void *  usr 
)
virtual

Adds a task pre-processor callback.

virtual void DtMoveAlongRouteTimeEstimator::addTaskProcessor ( DtSimTaskMessageType  t,
TaskCallbackFcn  fcn,
void *  usr 
)
virtual

Adds a task processor callback.

virtual void DtMoveAlongRouteTimeEstimator::addSetPreprocessor ( DtSetMessageType  t,
SetCallbackFcn  fcn,
void *  usr 
)
virtual

Adds a set pre-processor callback.

virtual void DtMoveAlongRouteTimeEstimator::addSetProcessor ( DtSetMessageType  t,
SetCallbackFcn  fcn,
void *  usr 
)
virtual

Adds a set processor callback.

static DtMoveAlongRouteTimeEstimator* DtMoveAlongRouteTimeEstimator::createAndInitialize ( )
static

Creates and initializes a new estimator.

virtual void DtMoveAlongRouteTimeEstimator::printState ( std::ostream &  strm) const
virtual

Prints the current state to the specified output stream.

virtual DtVector DtMoveAlongRouteTimeEstimator::calculateLocationOfPositionOnRoute ( double  pos,
const DtVertexList vertices 
) const
protectedvirtual

Calculates the geocentric location of a point on a route.

Called by estimateTimes().

Parameters
pos- The position on the route defined as a floating point value based on the vertices of the route: e.g. 0.75 is 75% of the way between vertex 0 and 1 and 2.35 is 35% of the way between vertex 2 and 3.
vertices- The geocentric vertices of the route.
Returns
The geocentric location of the point on the the route, or 0,0,0 if it could not be determined.
virtual double DtMoveAlongRouteTimeEstimator::calculateTravelTime ( const DtVector currLoc,
const DtVector nextLoc,
double  currentSpeed,
double  preferredSpeed,
double newSpeed,
double newAcceleration 
) const
protectedvirtual

Calculates the time to get from one location to the next given current settings and specified entity capabilities.

Called by estimateTimes().

Parameters
currLoc- The current location (geocentric).
nextLoc- The location to which we are traveling (geocentric).
currentSpeed- The starting speed.
preferredSpeed- The preferred speed.
newSpeed- Speed at arrival at nextPos.
newAcceleration- Acceleration at arrival at nextPos.
Returns
The time it takes to travel from the currPos to the nextPos.
virtual double DtMoveAlongRouteTimeEstimator::calculatesDistanceToTarget ( const DtVector currLoc,
double  currPos,
const DtVertexList vertices,
double  targetPos 
) const
protectedvirtual

Calculates an estimated distance to the target position.

Parameters
currLoc- The current location (geocentric).
currPos- The approximate current position along the route defined as a floating point value based on the vertices of the route.
vertices- The geocentric vertices of the route.
currPos- The target position along the route defined as a floating point value based on the vertices of the route.
void DtMoveAlongRouteTimeEstimator::sanityCheckCurrentSettings ( )
protected

Performs a sanity check on current settings and adjusts some of the current values to ensure correctness before beginning estimates.

virtual void DtMoveAlongRouteTimeEstimator::processHold ( const DtVertexList vertices,
double  position 
)
protectedvirtual

Performs a hold at the specified position, determining hold time based on desired time arrival time.

void DtMoveAlongRouteTimeEstimator::preprocessAction ( const DtRouteAction action,
const DtVertexList vertices,
double  position 
)
protected

Pre-process the given action. Calls preprocessTask() or preprocessSet() accordingly.

void DtMoveAlongRouteTimeEstimator::processAction ( const DtRouteAction action,
const DtVertexList vertices,
double  position 
)
protected

Process the given action. Calls processTask() or processSet() accordingly.

void DtMoveAlongRouteTimeEstimator::preprocessTask ( DtSimTask task,
const DtVertexList vertices,
double  position 
)
protected

Pre-processes the given task.

All tasks and sets are pre-processed in order prior to performing calculations. This allows us to save information about future tasks or sets as necessary before performing the actual calculations.

void DtMoveAlongRouteTimeEstimator::preprocessSet ( DtSetDataRequest set,
const DtVertexList vertices,
double  position 
)
protected

Pre-processes the given set.

All tasks and sets are pre-processed in order prior to performing calculations. This allows us to save information about future tasks or sets as necessary before performing the actual calculations.

void DtMoveAlongRouteTimeEstimator::processTask ( DtSimTask task,
const DtVertexList vertices,
double  position 
)
protected

Processes the given task.

Processing of a task may change current settings and affect time estimates going forward.

void DtMoveAlongRouteTimeEstimator::processSet ( DtSetDataRequest set,
const DtVertexList vertices,
double  position 
)
protected

Processes the given set.

Processing of a set may change current settings and affect time estimates going forward.

Member Data Documentation

const double DtMoveAlongRouteTimeEstimator::NoTimeSpecified
static
const double DtMoveAlongRouteTimeEstimator::NoRoutePositionSpecified
static
double DtMoveAlongRouteTimeEstimator::myCurrentTime
protected

Current state, initialized by user and updated by calculations.

DtVector DtMoveAlongRouteTimeEstimator::myCurrentLocation
protected
double DtMoveAlongRouteTimeEstimator::myTargetPosition
protected

Target position and the time at which we need to arrive there.

double DtMoveAlongRouteTimeEstimator::myTargetTime
protected
double DtMoveAlongRouteTimeEstimator::myHoldPosition
protected

Position at which to hold.

double DtMoveAlongRouteTimeEstimator::myEntityMinSpeed
protected

Entity characteristics, initialized by user.

double DtMoveAlongRouteTimeEstimator::myEntityMaxSpeed
protected
double DtMoveAlongRouteTimeEstimator::myEntityDefaultSpeed
protected
double DtMoveAlongRouteTimeEstimator::myEntityMaxAcceleration
protected
double DtMoveAlongRouteTimeEstimator::myEntityMaxDeceleration
protected
double DtMoveAlongRouteTimeEstimator::myCurrentMinSpeed
protected

Temporary preferences, updated by some actions during calculations.

double DtMoveAlongRouteTimeEstimator::myCurrentMaxSpeed
protected
double DtMoveAlongRouteTimeEstimator::myCurrentPreferredSpeed
protected
double DtMoveAlongRouteTimeEstimator::myCurrentSpeed
protected

Current state, updated by calculations.

double DtMoveAlongRouteTimeEstimator::myCurrentAcceleration
protected
TaskCallbackMap DtMoveAlongRouteTimeEstimator::myTaskPreprocessors
protected
TaskCallbackMap DtMoveAlongRouteTimeEstimator::myTaskProcessors
protected
SetCallbackMap DtMoveAlongRouteTimeEstimator::mySetPreprocessors
protected
SetCallbackMap DtMoveAlongRouteTimeEstimator::mySetProcessors
protected
Coordinate_System* DtMoveAlongRouteTimeEstimator::myCoordSys
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)