![]() |
VR-Forces 4.8 Class Documentation
|
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_System * | myCoordSys |
| 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 |
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.
| 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) |
|
protected |
|
protected |
|
protected |
|
protected |
| DtMoveAlongRouteTimeEstimator::DtMoveAlongRouteTimeEstimator | ( | ) |
|
virtual |
|
virtual |
Initializes the estimator by registering default task and set pre-processor and processor functions.
|
virtual |
Estimates the ETA at every vertex and action point along a route.
| 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 |
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 |
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 |
Sets the initial speed, in meters per second. Should be called prior to any time estimates.
|
virtual |
Initializes the entity's absolute maximum speed.
Should be initialized once and not changed by any calculations.
|
virtual |
The entity's absolute maximum speed.
|
virtual |
Initializes the entity's absolute minimum speed.
Should be initialized once and not changed by any calculations.
|
virtual |
The entity's absolute minimum speed.
|
virtual |
Initializes the entity's default speed.
Should be initialized once and not changed by any calculations.
|
virtual |
The entity's default speed.
|
virtual |
Initializes the entity's maximum acceleration.
Should be initialized once and not changed by any calculations.
|
virtual |
The entity's default speed.
|
virtual |
Initializes the entity's maximum deceleration.
Should be initialized once and not changed by any calculations.
|
virtual |
The entity's default speed.
|
virtual |
Sets the current geocentric location.
Called by calculations to adjust location as travel along the route is estimated.
|
virtual |
The current preferred speed.
|
virtual |
Sets the current time, in seconds.
Called by calculations to adjust elapsed time as travel along the route is estimated.
|
virtual |
The current time.
|
virtual |
Sets the current minimum speed.
May be called by calculations to adjust the minimum speed based on entity actions.
|
virtual |
The current minimum speed.
|
virtual |
Sets the current maximum speed.
May be called by calculations to adjust the maximum speed based on entity actions.
|
virtual |
The current maximum speed.
|
virtual |
Sets the current preferred speed.
May be called by calculations to adjust the maximum speed based on entity actions.
|
virtual |
The current preferred speed.
|
virtual |
Sets the current speed.
Updated by calculations to adjust speed. Should not be called directly by users!
|
virtual |
The current speed.
|
virtual |
Sets the current acceleration.
Updated by calculations to adjust acceleration. Should not be called directly by users!
|
virtual |
The current acceleration.
|
virtual |
Returns the target position along the route.
|
virtual |
Returns the time at which we should arrive at the target position.
|
virtual |
Returns the hold position along the route.
|
virtual |
Adds a task pre-processor callback.
|
virtual |
Adds a task processor callback.
|
virtual |
Adds a set pre-processor callback.
|
virtual |
Adds a set processor callback.
|
static |
Creates and initializes a new estimator.
|
virtual |
Prints the current state to the specified output stream.
|
protectedvirtual |
Calculates the geocentric location of a point on a route.
Called by estimateTimes().
| 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. |
|
protectedvirtual |
Calculates the time to get from one location to the next given current settings and specified entity capabilities.
Called by estimateTimes().
| 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. |
|
protectedvirtual |
Calculates an estimated distance to the target position.
| 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. |
|
protected |
Performs a sanity check on current settings and adjusts some of the current values to ensure correctness before beginning estimates.
|
protectedvirtual |
Performs a hold at the specified position, determining hold time based on desired time arrival time.
|
protected |
Pre-process the given action. Calls preprocessTask() or preprocessSet() accordingly.
|
protected |
Process the given action. Calls processTask() or processSet() accordingly.
|
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.
|
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.
|
protected |
Processes the given task.
Processing of a task may change current settings and affect time estimates going forward.
|
protected |
Processes the given set.
Processing of a set may change current settings and affect time estimates going forward.
|
static |
|
static |
|
protected |
Current state, initialized by user and updated by calculations.
|
protected |
|
protected |
Target position and the time at which we need to arrive there.
|
protected |
|
protected |
Position at which to hold.
|
protected |
Entity characteristics, initialized by user.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Temporary preferences, updated by some actions during calculations.
|
protected |
|
protected |
|
protected |
Current state, updated by calculations.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |