![]() |
VR-Forces 4.0.4 Class Documentation
|
DtRailMovementDriver determines how the entity should be moving along the segment. More...
Public Member Functions | |
| DtRailMovementDriver (DtRailMovementController *parentController, bool drivingOnLeft, bool allowPassing, double lookAhead, double hitTime) | |
| The DtSimComponent class is the base class for the entire simulation model component hierarchy. (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtRailMovementDriver () |
| destructor | |
| virtual void | setEntityState (DtVrfMovingObjectStateRepository *state) |
| virtual double | findDrivingSpeed (bool useAcceleration, DtVrfObject *convoyTgt=0, const double followDist=0.0, const bool useCatchUpSpeed=true) |
| Determines the speed to be used for the movement state. | |
| virtual double | calculateCurrentBrakingDistance () const |
| virtual void | setCurrentSegment (DtRailSegment *seg) |
| virtual DtRailSegment * | currentSegment () |
| virtual void | setTurnSpeed (const double speed) |
| virtual const double | turnSpeed () const |
| virtual double | determineSpeedGivenObs (const double drivingSpeed, const double hitTime, const DtRailObstructionPtr &obs) const |
| negative value means don't change anything | |
| virtual bool | isSwitchingLeft (const int current, const int passing) const |
| virtual bool | isSwitchingRight (const int current, const int passing) const |
| virtual int | findClosestLaneToDrivingLane (const int current, const int driving, const DtRailSegment *road) const |
| returns either a lane to switch in, or the current lane if it can't find a lane to switch to or 0. | |
| virtual bool | isObstructionConvoyTarget (const int lane, DtRailObstructionPtr &anObstruction, DtString convoyTgt) const |
| virtual bool | isLaneObstructed (const int lane, DtRailObstructionAnalyzer &analyzer) const |
| virtual bool | isObstructionStoppedOrSlow (double speed, DtRailObstructionPtr &obs) const |
| virtual bool | isDrivingLane (const int current, const int driving) const |
| virtual int | findOpenLeftLane (const int lane, const DtRailSegment *road, DtRailObstructionAnalyzer &analyzer) const |
| virtual int | findOpenRightLane (const int lane, const DtRailSegment *road, DtRailObstructionAnalyzer &analyzer) const |
| virtual int | findOpenLane (const int lane, const int passing, const DtRailSegment *road, DtRailObstructionAnalyzer &analyzer, bool checkOpposite=false) const |
| finds an open lane depending | |
| virtual bool | isTooCloseToObs (const DtRailObstructionPtr &nextObs, double bvRadiusSq) const |
| Compares the distanceSq between entity and nextObs and if that distance is less than 2 car lengths returns true. | |
| virtual bool | allowPassing () |
Protected Member Functions | |
| DtRailMovementDriver () | |
| default constructor - should not be called | |
| DtRailMovementDriver (const DtRailMovementDriver &orig) | |
| copy constructor | |
| DtRailMovementDriver & | operator= (const DtRailMovementDriver &orig) |
| assignment operator | |
Protected Attributes | |
| bool | myDrivingOnLeft |
| bool | myAllowPassing |
| double | myNearDistanceSq |
| bool | myNearTurnPoint |
| double | myTurnSpeed |
| double | myHitTime |
| double | myLookAheadDistance |
| DtVrfMovingObjectStateRepository * | myMovingObjectStateRepository |
| DtRailMovementController * | myController |
| DtRailSegment * | myCurrentSegment |
DtRailMovementDriver determines how the entity should be moving along the segment.
It determines the driving speed, whether the entity should pass another entity, come to a stop at an intersection and so forth.
| DtRailMovementDriver::DtRailMovementDriver | ( | DtRailMovementController * | parentController, |
| bool | drivingOnLeft, | ||
| bool | allowPassing, | ||
| double | lookAhead, | ||
| double | hitTime | ||
| ) |
The DtSimComponent class is the base class for the entire simulation model component hierarchy. (const DtString&,DtVrfObject*,DtSimManager*,
****** NOTE of API change for version 3.7 ****** Due to a performance enhancement change, the myComponentDescriptor member variable is now defined to be const and all access to this descriptor (including the componentDescriptor() method) have been changed to be const access. If you have used this descriptor to modify values within the descriptor (either in the original descriptor or a derived descriptor class), this modification will effect all entities that share this descriptor as this descriptor now points to the original parameter database entry.If you currently modify member variables in a descriptor class, it is suggested to instead make those member variables part of the component that uses them and modify them there. If you must modify the entries in the component descriptor, instead of using the supplied descriptor pointer, you will need to clone the descriptor entry and work with that clone. You will also need to delete this clone in your component destructor to avoid a memory leak.
(const DtString&,DtVrfObject*,DtSimManager*, DtComponentDescriptor*,DtReaderWriterRegistry* parentRegistry)| virtual DtRailMovementDriver::~DtRailMovementDriver | ( | ) | [virtual] |
destructor
| DtRailMovementDriver::DtRailMovementDriver | ( | ) | [protected] |
default constructor - should not be called
| DtRailMovementDriver::DtRailMovementDriver | ( | const DtRailMovementDriver & | orig | ) | [protected] |
copy constructor
| virtual void DtRailMovementDriver::setEntityState | ( | DtVrfMovingObjectStateRepository * | state | ) | [virtual] |
| virtual double DtRailMovementDriver::findDrivingSpeed | ( | bool | useAcceleration, |
| DtVrfObject * | convoyTgt = 0, |
||
| const double | followDist = 0.0, |
||
| const bool | useCatchUpSpeed = true |
||
| ) | [virtual] |
Determines the speed to be used for the movement state.
Segment's have a segment speed the entity will go at unless the ordered speed is smaller. If using acceleration will slow down before turns
| virtual double DtRailMovementDriver::calculateCurrentBrakingDistance | ( | ) | const [virtual] |
| virtual void DtRailMovementDriver::setCurrentSegment | ( | DtRailSegment * | seg | ) | [virtual] |
| virtual DtRailSegment* DtRailMovementDriver::currentSegment | ( | ) | [virtual] |
| virtual void DtRailMovementDriver::setTurnSpeed | ( | const double | speed | ) | [virtual] |
| virtual const double DtRailMovementDriver::turnSpeed | ( | ) | const [virtual] |
| virtual double DtRailMovementDriver::determineSpeedGivenObs | ( | const double | drivingSpeed, |
| const double | hitTime, | ||
| const DtRailObstructionPtr & | obs | ||
| ) | const [virtual] |
negative value means don't change anything
| virtual bool DtRailMovementDriver::isSwitchingLeft | ( | const int | current, |
| const int | passing | ||
| ) | const [virtual] |
| virtual bool DtRailMovementDriver::isSwitchingRight | ( | const int | current, |
| const int | passing | ||
| ) | const [virtual] |
| virtual int DtRailMovementDriver::findClosestLaneToDrivingLane | ( | const int | current, |
| const int | driving, | ||
| const DtRailSegment * | road | ||
| ) | const [virtual] |
returns either a lane to switch in, or the current lane if it can't find a lane to switch to or 0.
| virtual bool DtRailMovementDriver::isObstructionConvoyTarget | ( | const int | lane, |
| DtRailObstructionPtr & | anObstruction, | ||
| DtString | convoyTgt | ||
| ) | const [virtual] |
| virtual bool DtRailMovementDriver::isLaneObstructed | ( | const int | lane, |
| DtRailObstructionAnalyzer & | analyzer | ||
| ) | const [virtual] |
| virtual bool DtRailMovementDriver::isObstructionStoppedOrSlow | ( | double | speed, |
| DtRailObstructionPtr & | obs | ||
| ) | const [virtual] |
| virtual bool DtRailMovementDriver::isDrivingLane | ( | const int | current, |
| const int | driving | ||
| ) | const [virtual] |
| virtual int DtRailMovementDriver::findOpenLeftLane | ( | const int | lane, |
| const DtRailSegment * | road, | ||
| DtRailObstructionAnalyzer & | analyzer | ||
| ) | const [virtual] |
| virtual int DtRailMovementDriver::findOpenRightLane | ( | const int | lane, |
| const DtRailSegment * | road, | ||
| DtRailObstructionAnalyzer & | analyzer | ||
| ) | const [virtual] |
| virtual int DtRailMovementDriver::findOpenLane | ( | const int | lane, |
| const int | passing, | ||
| const DtRailSegment * | road, | ||
| DtRailObstructionAnalyzer & | analyzer, | ||
| bool | checkOpposite = false |
||
| ) | const [virtual] |
finds an open lane depending
| lane | Lane you are referencing from |
| passing | Lane you are already passing into (should be teh same as lane if you are not in the middle of switching) this particular parameter matters in that it will only find a lane towards the passing lane if you set this. |
| entityOffset | Offset value |
| obstructions | The list of obstructions |
| road | The rail segment you are driving on |
| drivingSpeed | speed that you are going |
| convoyTgt | whether you have a convoy target or not, and who is that convoy target |
| checkOpposite | whether or not to check lanes in the opposite direction or not |
| virtual bool DtRailMovementDriver::isTooCloseToObs | ( | const DtRailObstructionPtr & | nextObs, |
| double | bvRadiusSq | ||
| ) | const [virtual] |
Compares the distanceSq between entity and nextObs and if that distance is less than 2 car lengths returns true.
| virtual bool DtRailMovementDriver::allowPassing | ( | ) | [inline, virtual] |
| DtRailMovementDriver& DtRailMovementDriver::operator= | ( | const DtRailMovementDriver & | orig | ) | [protected] |
assignment operator
bool DtRailMovementDriver::myDrivingOnLeft [protected] |
bool DtRailMovementDriver::myAllowPassing [protected] |
double DtRailMovementDriver::myNearDistanceSq [protected] |
bool DtRailMovementDriver::myNearTurnPoint [protected] |
double DtRailMovementDriver::myTurnSpeed [protected] |
double DtRailMovementDriver::myHitTime [protected] |
double DtRailMovementDriver::myLookAheadDistance [protected] |
DtRailSegment* DtRailMovementDriver::myCurrentSegment [protected] |