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

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 DtRailSegmentcurrentSegment ()
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, const DtUUID &convoyTgt) const
virtual bool isLaneObstructed (const int lane, DtRailObstructionAnalyzer &analyzer, bool checkForwardOnly=false) 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
DtRailMovementDriveroperator= (const DtRailMovementDriver &orig)
 assignment operator

Protected Attributes

bool myDrivingOnLeft
bool myAllowPassing
double myNearDistanceSq
bool myNearTurnPoint
double myTurnSpeed
double myHitTime
double myLookAheadDistance
DtVrfMovingObjectStateRepositorymyMovingObjectStateRepository
DtRailMovementControllermyController
DtRailSegmentmyCurrentSegment

Detailed Description

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.

Constructor & Destructor Documentation

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.

Related examples
Other uses in examples
(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

Member Function Documentation

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,
const DtUUID convoyTgt 
) const
virtual
virtual bool DtRailMovementDriver::isLaneObstructed ( const int  lane,
DtRailObstructionAnalyzer analyzer,
bool  checkForwardOnly = false 
) const
virtual
Parameters
checkForwardOnlyIf true, then only obstructions in front of the entity are checked. If they overlap, they are ignored. This is typically true for checking current lane, but false for checking adjacent lanes for passing purposes.
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

Parameters
laneLane you are referencing from
passingLane 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.
entityOffsetOffset value
obstructionsThe list of obstructions
roadThe rail segment you are driving on
drivingSpeedspeed that you are going
convoyTgtwhether you have a convoy target or not, and who is that convoy target
checkOppositewhether 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 ( )
inlinevirtual
DtRailMovementDriver& DtRailMovementDriver::operator= ( const DtRailMovementDriver orig)
protected

assignment operator

Member Data Documentation

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
DtVrfMovingObjectStateRepository* DtRailMovementDriver::myMovingObjectStateRepository
protected
DtRailMovementController* DtRailMovementDriver::myController
protected
DtRailSegment* DtRailMovementDriver::myCurrentSegment
protected

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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)