![]() |
VR-Forces Developer's Guide
|
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.
Classes | |
| struct | InputRoute |
| struct | OutputEstimates |
| struct | PlannedSpeed |
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) |
| typedef std::vector< PlannedSpeed > | PlannedSpeedList |
Public Member Functions | |
| DtMoveAlongRouteTimeEstimator () | |
| virtual | ~DtMoveAlongRouteTimeEstimator () |
| virtual void | initialize () |
| virtual void | estimateTimes (const InputRoute &routeInput, OutputEstimates &estimates) |
| virtual void | addTaskPreprocessor (DtSimTaskMessageType t, TaskCallbackFcn fcn, void *usr) |
| virtual void | addTaskProcessor (DtSimTaskMessageType t, TaskCallbackFcn fcn, void *usr) |
| virtual void | addSetPreprocessor (DtSetMessageType t, SetCallbackFcn fcn, void *usr) |
| virtual void | addSetProcessor (DtSetMessageType t, SetCallbackFcn fcn, void *usr) |
| virtual void | printState (std::ostream &strm) const |
Initialization functions for starting entity state | |
| virtual void | setInitialGeocentricLocation (const DtVector &geocLoc) |
| virtual void | setInitialTime (double t) |
| virtual void | setInitialSpeed (double s) |
Initialization functions for entity movement capabilities | |
| virtual void | setEntityMaxSpeed (double speed) |
| virtual double | entityMaxSpeed () const |
| virtual void | setEntityMinSpeed (double speed) |
| virtual double | entityMinSpeed () const |
| virtual void | setEntityDefaultSpeed (double speed) |
| virtual double | entityDefaultSpeed () const |
| virtual void | setEntityMaxAcceleration (double accel) |
| virtual double | entityMaxAcceleration () const |
| virtual void | setEntityMaxDeceleration (double decel) |
| virtual double | entityMaxDeceleration () const |
Estimator functions. Used during estimation calculations. | |
| virtual void | setCurrentGeocentricLocation (const DtVector &geocLoc) |
| virtual DtVector | currentGeocentricLocation () const |
| virtual void | setCurrentTime (double t) |
| virtual double | currentTime () const |
| virtual void | setCurrentMinSpeed (double speed) |
| virtual double | currentMinSpeed () const |
| virtual void | setCurrentMaxSpeed (double speed) |
| virtual double | currentMaxSpeed () const |
| virtual void | setCurrentPreferredSpeed (double speed) |
| virtual double | currentPreferredSpeed () const |
| virtual void | setCurrentSpeed (double speed) |
| virtual double | currentSpeed () const |
| virtual void | setCurrentAcceleration (double speed) |
| virtual double | currentAcceleration () const |
| virtual double | targetPosition () const |
| virtual double | targetTime () const |
| virtual double | holdPosition () const |
| virtual void | addPlannedSpeed (double routePosition, double speed, bool required) |
| virtual PlannedSpeedList | plannedSpeeds () const |
Static Public Member Functions | |
| static DtMoveAlongRouteTimeEstimator * | createAndInitialize () |
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 |
| virtual double | calculateTravelTime (const DtVector &currLoc, const DtVector &nextLoc, double currentSpeed, double preferredSpeed, double &newSpeed, double &newAcceleration) const |
| virtual double | calculateDistanceToTarget (const DtVector &currLoc, double currPos, const DtVertexList &vertices, double targetPos) const |
| virtual double | calculateTimeAndDistanceAtRequiredSpeeds (double currPos, const DtVertexList &vertices, double targetPos, const PlannedSpeedList &plannedSpeeds, double &distanceAtRequiredSpeeds) const |
| virtual void | sanityCheckCurrentSettings () |
| virtual void | processHold (const DtVertexList &vertices, double position) |
| void | preprocessAction (const DtRouteAction &action, const DtVertexList &vertices, double position) |
| void | processAction (const DtRouteAction &action, const DtVertexList &vertices, double position) |
| void | preprocessTask (DtSimTask *task, const DtVertexList &vertices, double position) |
| void | preprocessSet (DtSetDataRequest *set, const DtVertexList &vertices, double position) |
| void | processTask (DtSimTask *task, const DtVertexList &vertices, double position) |
| void | processSet (DtSetDataRequest *set, const DtVertexList &vertices, double position) |
| 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) |
| typedef std::vector<PlannedSpeed> DtMoveAlongRouteTimeEstimator::PlannedSpeedList |
|
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 |
Informs the estimator of planned ordered speed changes.
|
virtual |
Returns the future ordered speeds list.
|
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 | - Output speed at arrival at nextPos. |
| newAcceleration | - Output 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. |
| targetPos | - The target position along the route defined as a floating point value based on the vertices of the route. |
|
protectedvirtual |
Calculates the time and distance the entity is required to move at user specified speeds. During these times we will not be able to adjust speeds to meet target times, so they can be removed from the calculation to determine how we should adjust our speed.
| 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. |
| targetPos | - The target position along the route defined as a floating point value based on the vertices of the route. |
| plannedSpeeds | - The list of route segments where that are planned to use specific, required speeds. |
| distanceAtRequiredSpeeds | - Output distance covered at required speeds. |
|
protectedvirtual |
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 |
Current state, initialized by user and updated by calculations.
|
protected |
Target position and the time at which we need to arrive there.
|
protected |
Target position and the time at which we need to arrive there.
|
protected |
Position at which to hold.
|
protected |
Entity characteristics, initialized by user.
|
protected |
Entity characteristics, initialized by user.
|
protected |
Entity characteristics, initialized by user.
|
protected |
Entity characteristics, initialized by user.
|
protected |
Entity characteristics, initialized by user.
|
protected |
Entity characteristics, initialized by user.
|
protected |
Temporary preferences, updated by some actions during calculations.
|
protected |
Temporary preferences, updated by some actions during calculations.
|
protected |
Temporary preferences, updated by some actions during calculations.
|
protected |
Current state, updated by calculations.
|
protected |
Current state, updated by calculations.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |