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

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
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