Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 3a5bdb2c authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

Pull request #907: DriverStrategy: additional criteria for switching from coasting to braking.

Merge in VECTO/vecto-sim from VECTO/mq_vecto-sim:VECTO-1643-error-gear-6l-lossmap-data-was-extrapolated-in-declaration-mode to develop

* commit 'adb7aeb0':
  DriverStrategy: additional criteria for switching from coasting to braking. in case the braking phase is very short (smaller than half of the lower-bound simulation time interval), immediately switch to braking
parents d3069674 adb7aeb0
No related branches found
No related tags found
No related merge requests found
......@@ -1381,6 +1381,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Log.Debug("Switching to BRAKE Phase. currentDistance: {0}", currentDistance);
} else {
if ((currentDistance + ds).IsGreater(DriverStrategy.BrakeTrigger.BrakingStartDistance)) {
var remainingDistance = DriverStrategy.BrakeTrigger.TriggerDistance -
DriverStrategy.BrakeTrigger.BrakingStartDistance;
var remainingTime = remainingDistance / DataBus.VehicleInfo.VehicleSpeed;
var brakingIntervalTooShort = remainingTime.IsSmaller(
Constants.SimulationSettings.LowerBoundTimeInterval / 2);
if (brakingIntervalTooShort) {
Phase = BrakingPhase.Brake;
return null;
}
return new ResponseDrivingCycleDistanceExceeded(this) {
MaxDistance = DriverStrategy.BrakeTrigger.BrakingStartDistance - currentDistance
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment