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 9bcb522e authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

bugfix in driver model

parent d2dddc4d
No related branches found
No related tags found
No related merge requests found
...@@ -206,23 +206,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -206,23 +206,20 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}; };
} }
CurrentState.Acceleration = operatingPoint.Acceleration; Log.Debug("Found operating point for coasting. dt: {0}, acceleration: {1}", operatingPoint.SimulationInterval,
CurrentState.dt = operatingPoint.SimulationInterval; operatingPoint.Acceleration);
Log.Debug("Found operating point for coasting. dt: {0}, acceleration: {1}", CurrentState.dt,
CurrentState.Acceleration);
operatingPoint = LimitAccelerationByDriverModel(operatingPoint, true); operatingPoint = LimitAccelerationByDriverModel(operatingPoint, true);
CurrentState.Acceleration = operatingPoint.Acceleration;
CurrentState.dt = operatingPoint.SimulationInterval;
// compute speed at the end of the simulation interval. if it exceeds the limit -> return // compute speed at the end of the simulation interval. if it exceeds the limit -> return
var v2 = DataBus.VehicleSpeed() + operatingPoint.Acceleration * operatingPoint.SimulationInterval; var v2 = DataBus.VehicleSpeed() + operatingPoint.Acceleration * operatingPoint.SimulationInterval;
if (v2 > maxVelocity) { if (v2 > maxVelocity) {
return new ResponseSpeedLimitExceeded(); return new ResponseSpeedLimitExceeded();
} }
CurrentState.dt = operatingPoint.SimulationInterval;
CurrentState.Acceleration = operatingPoint.Acceleration;
var retVal = Next.Request(absTime, CurrentState.dt, CurrentState.Acceleration, gradient); var retVal = Next.Request(absTime, CurrentState.dt, CurrentState.Acceleration, gradient);
CurrentState.Response = retVal; CurrentState.Response = retVal;
retVal.SimulationInterval = CurrentState.dt; retVal.SimulationInterval = CurrentState.dt;
...@@ -276,8 +273,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -276,8 +273,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
operatingPoint = SearchBrakingPower(absTime, operatingPoint.SimulationDistance, gradient, operatingPoint = SearchBrakingPower(absTime, operatingPoint.SimulationDistance, gradient,
operatingPoint.Acceleration, response); operatingPoint.Acceleration, response);
if (!ds.IsEqual(operatingPoint.SimulationDistance)) { if (!ds.IsEqual(operatingPoint.SimulationDistance, 1E-15)) {
Log.Debug( Log.Info(
"SearchOperatingPoint Breaking reduced the max. distance: {0} -> {1}. Issue new request from driving cycle!", "SearchOperatingPoint Breaking reduced the max. distance: {0} -> {1}. Issue new request from driving cycle!",
operatingPoint.SimulationDistance, ds); operatingPoint.SimulationDistance, ds);
return new ResponseDrivingCycleDistanceExceeded { MaxDistance = operatingPoint.SimulationDistance }; return new ResponseDrivingCycleDistanceExceeded { MaxDistance = operatingPoint.SimulationDistance };
...@@ -318,7 +315,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -318,7 +315,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
DeclarationData.Driver.LookAhead.Deceleration); DeclarationData.Driver.LookAhead.Deceleration);
operatingPoint.Acceleration = DeclarationData.Driver.LookAhead.Deceleration; operatingPoint.Acceleration = DeclarationData.Driver.LookAhead.Deceleration;
operatingPoint.SimulationInterval = operatingPoint.SimulationInterval =
ComputeTimeInterval(CurrentState.Acceleration, operatingPoint.SimulationDistance).SimulationInterval; ComputeTimeInterval(operatingPoint.Acceleration, operatingPoint.SimulationDistance).SimulationInterval;
Log.Debug("Changed dt due to limited coasting deceleration. dt: {0}", CurrentState.dt); Log.Debug("Changed dt due to limited coasting deceleration. dt: {0}", CurrentState.dt);
} }
return operatingPoint; return operatingPoint;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment