Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit adb7aeb0 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

DriverStrategy: additional criteria for switching from coasting to braking. in...

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
parent d3069674
No related branches found
No related tags found
No related merge requests found
...@@ -1381,6 +1381,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -1381,6 +1381,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Log.Debug("Switching to BRAKE Phase. currentDistance: {0}", currentDistance); Log.Debug("Switching to BRAKE Phase. currentDistance: {0}", currentDistance);
} else { } else {
if ((currentDistance + ds).IsGreater(DriverStrategy.BrakeTrigger.BrakingStartDistance)) { 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) { return new ResponseDrivingCycleDistanceExceeded(this) {
MaxDistance = DriverStrategy.BrakeTrigger.BrakingStartDistance - currentDistance MaxDistance = DriverStrategy.BrakeTrigger.BrakingStartDistance - currentDistance
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment