VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
roadDrivingLogic.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 #include "vrfmodel/roadSegment.h"
13 
17 
19 {
20 public:
21  DtRoadDrivingLogic(DtRoadMovementController * parentController);
23 
29 
33  virtual double maxDesignDriverLateralAcceleration_G(){ return 0.15; }
34 
38  virtual double desiredDecelerationFractionOfMax(){ return 0.3; }
42  virtual double desiredAccelerationFractionOfMax(){ return 0.5; }
46  virtual double desiredLateralAccelerationFractionOfMax(){ return 0.4; }
47 
52  virtual double desiredFixedHeadway(){ return 1.0; }
53 
56  virtual double desiredDynamicHeadway(double currentSpeed)
57  {
58  return DtMax(desiredFixedHeadway(), currentSpeed * 3.0);
59  }
60 
67  virtual double minimumCurveSpeed(){ return 1.0; }
68 
73  virtual double maximumLaneChangeTurnAngle(){ return 0.8; }
74 
79  virtual double laneChangeFractionToClearLane(){ return 0.4; }
80 
86  virtual double laneEndCheckLookaheadTime(){ return 15.0; }
87 
92  virtual double laneSwitchDecisionAccelThreshold(){ return 2.0; }
93 
100  virtual double maxForcedDecelForGapAcceptance(){ return -4.0; }
101 
103 
110 
131  virtual double combinedAcceleration(
132  DtRoadSegment* currentRoadSegment,
133  const double desiredDecelToUse,
134  const double tickPeriod,
135  const double currentSpeed,
136  const double orderedSpeed,
137  const int laneNumber,
138  const double positionInLane,
139  const double laneSpaceRequired,
140  const double laneChangeWidth,
141  const double maxAcceleration,
142  const double maxLateralAccel,
143  bool &laneContinues,
144  bool & pathContinues,
145  double & distanceToLaneEnd,
146  double & freeFlowAccel,
147  double &orderedSpeedAccel,
148  bool allowOverrideSpeedLimit = false,
149  bool debug = false);
150 
203  virtual int selectedLane(
204  DtRoadSegment* currentRoadSegment,
205  const int roadLaneN,
206  const bool currentLaneContinues,
207  const double distanceToLaneEnd,
208  const double positionInLane,
209  const double currentSpeed,
210  const double currentLaneAcceleration,
211  const double freeFlowAcceleration,
212  const double tickPeriod,
213  const double desiredDecelToUse,
214  const double maxLateralAccel,
215  const DtSimObject* convoyTgt,
216  int& desiredFutureLane,
217  bool debug = false
218  );
219 
225  virtual double oldLaneObstacleConstraint(
226  DtRoadSegment* currentSegment, const DtMovingObjectParameters* params,
227  const double currentPosition, const double currentOffset,
228  const DtRoadObstructionFinder* obstructionFinder,
229  const double desiredDecelToUse, const double dt,
230  const double accelForNoObstacle, const double currentSpeed,
231  const int currentLaneN, std::vector<DtVector>& obstacleLocations,
232  std::vector<std::vector<DtVector> >& debugBoxes, bool debug = false);
233 
238  virtual double distanceNeededToChangeLanes(
239  const double minTurnRadius,
240  const double distanceBetweenLanes,
241  const double speed,
242  bool debug = false);
243 
245 
246 protected:
247 
252 
253  double followConvoyAcceleration(
254  const double currentSpeed, const double tickPeriod,
255  const double deceleration,
256  const double convoyGap,
257  const DtSimObject* leadVehicle, bool debug = false);
258 
262  virtual double orderedSpeedAcceleration(const double currentSpeed,
263  const double orderedSpeed,
264  const double dt,
265  bool debug = false);
266 
278  virtual double extraAccelConstraint(const double currentSpeed,
279  const double dt, bool debug = false)
280  { return 1e8; }
281 
291  double downstreamTcdAccelConstraint(
292  DtRoadSegment* startSegment,
293  const double desiredDecelToUse,
294  const double dt, const double currentSpeed, const int roadLaneN,
295  const double positionAlongLane,
296  const double maxAccel, const double maxLateralAccel,
297  bool debug = false);
298 
299 
320  virtual double downstreamCurveAccelConstraint(
321  DtRoadSegment* startSegment,
322  const double desiredDecelToUse,
323  const double dt, const double currentSpeed, const int roadLaneN,
324  const double positionAlongLane,
325  const double maxAccel, const double maxLateralAccel, bool debug = false);
326 
337  virtual double downstreamSpeedLimitAccelConstraint(DtRoadSegment* currentSegment,
338  const double desiredDecelToUse,
339  const double dt, const double currentSpeed, bool allowOverrideSpeedLimit=false, bool debug = false);
340 
372  virtual double laneEndAccelConstraint(
373  DtRoadSegment* currentSegment, const double orderedSpeed,
374  const double desiredDecelToUse,
375  const double dt, const double currentSpeed, const int roadLaneN,
376  const double positionAlongLane,
377  const double extraSpaceRequired,
378  const double maxAccel,
379  bool & laneContinues,
380  double & distanceToLaneEnd, bool & pathContinues, bool debug = false);
381 
403  virtual double obstacleAccelConstraint(
404  DtRoadSegment* currentSegment,
405  const DtRoadObstructionFinder* obstructionFinder,
406  const double maxAcceleration,
407  const double desiredDecelToUse, const double dt, const double currentSpeed,
408  const int roadLaneN, const double positionAlongLane,
409  const double spaceNeeded,
410  double& obstacleDistanceAhead,
411  double& obstacleSpeed, std::vector<std::vector<DtVector> > & debugBoxes, std::vector<DtVector>& obstacleLocations, bool debug = false);
412 
441  virtual double completeLaneChangeMnvrAccelConstraint(
442  DtRoadSegment* currentSegment, const double currentOffset,
443  const double desiredDecelToUse, const DtMovingObjectParameters* params,
444  const double dt,
445  const double accelForNoObstacle, const double currentSpeed,
446  const double completionFraction,
447  const double completionDistance, bool debug = false);
448 
450 
451 
457  virtual bool laneConstrainedBelowFreeFlow(const double currentLaneAcceleration,
458  const double otherLaneAcceleration,
459  const double tickPeriod,
460  const double currentSpeed);
461 
470  virtual bool mergeGapAvailableBehind(const DtRoadSegment* currentRoadSegment,
471  const int roadLaneNum, const double positionInLane,
472  const double nominalDecel, const double tickPeriod,
473  const double ownSpeed, bool debug = false);
474 
475 
476 protected:
478 };
virtual double maxDesignDriverLateralAcceleration_G()
Typical value (see AASHTO Green Book), civilian driver comfort level. In Gs. This is used as an assum...
Definition: roadDrivingLogic.h:33
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual double maximumLaneChangeTurnAngle()
The maximum angle a vehicle makes with the lane direction when it is changing lanes (slowly)...
Definition: roadDrivingLogic.h:73
virtual double maxForcedDecelForGapAcceptance()
When the vehicle is considering merging into an adjacent lane, the deceleration required of a vehicle...
Definition: roadDrivingLogic.h:100
virtual double desiredDecelerationFractionOfMax()
This could be overridden to use an entity-specific &quot;aggressiveness&quot; parameter.
Definition: roadDrivingLogic.h:38
DtRoadMovementController * myParentController
Definition: roadDrivingLogic.h:477
virtual double desiredAccelerationFractionOfMax()
This could be overridden to use an entity-specific &quot;aggressiveness&quot; parameter.
Definition: roadDrivingLogic.h:42
DtRoadMovementController is a movement controller that models an entity&#39;s movement along a road path...
Definition: roadMovementController.h:65
virtual double minimumCurveSpeed()
A minimum speed to go around curves, especially artificially sharp curves generated by awkwardly form...
Definition: roadDrivingLogic.h:67
virtual double laneEndCheckLookaheadTime()
The time before reaching the end of a lane that the entity starts to prefer to be in a lane that cont...
Definition: roadDrivingLogic.h:86
virtual double laneSwitchDecisionAccelThreshold()
The difference in acceleration between an adjacent lane and the current lane that will trigger a lane...
Definition: roadDrivingLogic.h:92
virtual double extraAccelConstraint(const double currentSpeed, const double dt, bool debug=false)
A placeholder for user extension. This function is called whether the entity is following a convoy ve...
Definition: roadDrivingLogic.h:278
The moving-object-param parameter type is used for objects that are capable of movement, such as individual entities and aggregates. DtMovingObjectParameters; holds all of the configurable parameters for the DtVrfMovingObjectStateRepository class. Parameters include support points, maximum speed, maximum reverse speed, turning radius, maximum slope, ordered speed, maximum acceleration, maximum deceleration, and fuel efficiency. Aggregates are moving objects and have this parameter type. All of the platform-specific parameter types derive from this one. .
Definition: movingObjectParameters.h:32
virtual double desiredDynamicHeadway(double currentSpeed)
The desired dynamic headway between cars when one is following another based on the current speed of ...
Definition: roadDrivingLogic.h:56
virtual double desiredFixedHeadway()
The desired fixed gap between cars when one is following the other (very slowly, or stopped)...
Definition: roadDrivingLogic.h:52
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:80
Description of one segment of a road.
Definition: roadSegment.h:408
An object containing functions to find obstructions in road segments in a road path; part of a DtRoad...
Definition: roadObstructionFinder.h:30
virtual double laneChangeFractionToClearLane()
The fraction of a lane change maneuver that a vehicle has to complete before it can ignore obstacles ...
Definition: roadDrivingLogic.h:79
Definition: roadDrivingLogic.h:18
virtual double desiredLateralAccelerationFractionOfMax()
This could be overridden to use an entity-specific &quot;aggressiveness&quot; parameter.
Definition: roadDrivingLogic.h:46

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)