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

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

Pull request #926: Bugfix: avoiding short simulation interval.

Merge in VECTO/vecto-sim from VECTO/mq_vecto-sim:bugfix/VECTO-1681-error-message-gear-x-loss-map-extrapolated-range-for-loss-map-not-sufficient-not to develop

* commit '24768e2d':
  Bugfix: avoiding short simulation interval. in case the vehicle speed is already below the target speed of the current  'next driving action' and the trigger distance is reached, assume the current 'next driving action' as completed and switch to the next one.
parents d3c2744d 24768e2d
No related branches found
No related tags found
No related merge requests found
......@@ -558,12 +558,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// update action distance for current 'next action'
UpdateDistancesForCurrentNextAction();
SetNextDrivingAction(currentDistance, nextAction);
SetNextDrivingAction(currentDistance, nextAction, ds);
}
Log.Debug("Next Driving Action: {0}", NextDrivingAction);
}
private void SetNextDrivingAction(Meter currentDistance, DrivingBehaviorEntry nextAction)
private void SetNextDrivingAction(Meter currentDistance, DrivingBehaviorEntry nextAction, Meter ds)
{
if (nextAction != null) {
if (nextAction.HasEqualTrigger(NextDrivingAction)) {
......@@ -577,6 +577,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (nextAction.ActionDistance < NextDrivingAction.ActionDistance) {
NextDrivingAction = nextAction;
}
if ((currentDistance + ds).IsEqual(NextDrivingAction.TriggerDistance) && Driver.DataBus.VehicleInfo.VehicleSpeed < NextDrivingAction.NextTargetSpeed) {
// the currently active NextDrivingAction already reached the target speed - ignore it.
NextDrivingAction = nextAction;
}
}
} else {
NextDrivingAction = null;
......
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