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

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

change: costing no longer relies on minimum velocity. only if distance is...

change: costing no longer relies on minimum velocity. only if distance is negative braking starts immediately
parent 9f26dc77
No related branches found
No related tags found
No related merge requests found
...@@ -274,8 +274,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -274,8 +274,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var currentSpeed = Driver.DataBus.VehicleSpeed; var currentSpeed = Driver.DataBus.VehicleSpeed;
// distance until halt // distance until halt
var lookaheadDistance = Formulas.DecelerationDistance(currentSpeed, 0.SI<MeterPerSecond>(), //var lookaheadDistance = Formulas.DecelerationDistance(currentSpeed, 0.SI<MeterPerSecond>(),
Driver.DriverData.LookAheadCoasting.Deceleration); // Driver.DriverData.LookAheadCoasting.Deceleration);
var lookaheadDistance = (currentSpeed.Value() * 3.6 * 10).SI<Meter>();
lookaheadDistance = VectoMath.Max(2 * ds, 1.2 * lookaheadDistance); lookaheadDistance = VectoMath.Max(2 * ds, 1.2 * lookaheadDistance);
var lookaheadData = Driver.DataBus.LookAhead(lookaheadDistance); var lookaheadData = Driver.DataBus.LookAhead(lookaheadDistance);
...@@ -287,8 +289,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -287,8 +289,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
: entry.VehicleTargetSpeed; : entry.VehicleTargetSpeed;
if (nextTargetSpeed < currentSpeed) { if (nextTargetSpeed < currentSpeed) {
var coastingDistance = ComputeCoastingDistance(currentSpeed, entry); var coastingDistance = ComputeCoastingDistance(currentSpeed, entry);
if (!Driver.DriverData.LookAheadCoasting.Enabled || if ( /*!Driver.DriverData.LookAheadCoasting.Enabled ||
currentSpeed < Driver.DriverData.LookAheadCoasting.MinSpeed || currentSpeed < Driver.DriverData.LookAheadCoasting.MinSpeed || */
coastingDistance < 0) { coastingDistance < 0) {
var brakingDistance = Driver.ComputeDecelerationDistance(nextTargetSpeed) + BrakingSafetyMargin; var brakingDistance = Driver.ComputeDecelerationDistance(nextTargetSpeed) + BrakingSafetyMargin;
Log.Debug( Log.Debug(
......
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