Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 39396f2e authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Merge remote-tracking branch...

Merge remote-tracking branch 'quaritsch/feature/VECTO-125-comparison-of-vecto2.2-and-vecto3' into feature/VECTO-124-pdf-report
parents a32a6a5e 9c1082a9
Branches EDELIVERY-12495-update-eupl-licence-for-ddc
No related tags found
No related merge requests found
......@@ -78,6 +78,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return retVal;
}
public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient)
{
DriverBehavior = DrivingBehavior.Halted;
return Driver.DrivingActionHalt(absTime, dt, targetVelocity, gradient);
}
public DrivingBehavior DriverBehavior { get; internal set; }
private void UpdateDrivingAction(Meter currentDistance)
{
var nextAction = GetNextDrivingAction(currentDistance);
......@@ -126,15 +136,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
}
public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient)
{
DriverBehavior = DrivingBehavior.Halted;
return Driver.DrivingActionHalt(absTime, dt, targetVelocity, gradient);
}
public DrivingBehavior DriverBehavior { get; internal set; }
protected DrivingBehaviorEntry GetNextDrivingAction(Meter minDistance)
{
var currentSpeed = Driver.DataBus.VehicleSpeed;
......@@ -152,7 +153,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
? entry.VehicleTargetSpeed + Driver.DriverData.OverSpeedEcoRoll.OverSpeed
: entry.VehicleTargetSpeed;
if (nextTargetSpeed < currentSpeed) {
// TODO @@@quam currentSpeed ? targetSpeed? nextTargetSpeed?
if (!Driver.DriverData.LookAheadCoasting.Enabled ||
currentSpeed < Driver.DriverData.LookAheadCoasting.MinSpeed) {
var brakingDistance = Driver.ComputeDecelerationDistance(nextTargetSpeed);
......@@ -178,14 +178,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
});
}
}
//if (nextTargetSpeed > currentSpeed) {
// nextActions.Add(new DrivingBehaviorEntry {
// Action = DefaultDriverStrategy.DrivingBehavior.Accelerating,
// NextTargetSpeed = entry.VehicleTargetSpeed,
// TriggerDistance = entry.Distance,
// ActionDistance = entry.Distance
// });
//}
}
return nextActions.Count == 0 ? null : nextActions.OrderBy(x => x.ActionDistance).First();
......
......@@ -125,6 +125,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_currentState.dt = dt;
_currentState.Acceleration = acceleration;
_currentState.Velocity = _previousState.Velocity + acceleration * dt;
if (_currentState.Velocity.IsEqual(0, 1e-4)) {
_currentState.Velocity = 0.SI<MeterPerSecond>();
}
_currentState.Distance = _previousState.Distance + dt * (_previousState.Velocity + _currentState.Velocity) / 2;
_currentState.DriverAcceleration = DriverAcceleration(acceleration);
......
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