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

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

Merge pull request #179 in VECTO/vecto-sim from...

Merge pull request #179 in VECTO/vecto-sim from ~EMKRISPMI/vecto-sim:hotfix/VECTO-271-distancerun-unexpected-response to master

* commit '3d38f241':
  FullLoadCurve: Removed fallback to engine full load curve in gearbox in declaration mode
  [VECTO-271] corrected error: DistanceRun got an unexpected response: ResponseGearShift
parents e046c662 3d38f241
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,8 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
......
......@@ -191,7 +191,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper
retVal.Gears = gears.Select((gear, i) => {
var gearLossMap = TransmissionLossMap.Create(gear.LossMap, gear.Ratio, string.Format("Gear {0}", i + 1));
var gearFullLoad = gear.FullLoadCurve == null
? engine.FullLoadCurve
? null
: FullLoadCurveReader.Create(gear.FullLoadCurve, true);
var fullLoadCurve = IntersectFullLoadCurves(engine.FullLoadCurve, gearFullLoad);
......@@ -265,7 +265,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper
return retVal;
}
private void WarnDeclarationMode(string inputData)
{
Log.Warn("{0} not in Declaration Mode!", inputData);
......@@ -276,7 +275,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper
return SetCommonRetarderData(retarder, vehicle);
}
public static List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> GetDeclarationAirResistanceCurve(
VehicleCategory vehicleCategory, SquareMeter aerodynamicDragAera)
{
......
......@@ -70,7 +70,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
protected internal DrivingBehaviorEntry BrakeTrigger { get; set; }
public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient)
{
if (CurrentDrivingMode == DrivingMode.DrivingModeBrake) {
......@@ -118,7 +117,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return Driver.DrivingActionHalt(absTime, dt, targetVelocity, gradient);
}
private void UpdateDrivingAction(Meter currentDistance, Meter ds)
{
var nextAction = GetNextDrivingAction(currentDistance, ds);
......@@ -166,7 +164,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
Log.Debug("Next Driving Action: {0}", NextDrivingAction);
}
protected DrivingBehaviorEntry GetNextDrivingAction(Meter minDistance, Meter ds)
{
var currentSpeed = Driver.DataBus.VehicleSpeed;
......@@ -225,7 +222,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
//=====================================
public interface IDriverMode
{
DefaultDriverStrategy DriverStrategy { get; set; }
......@@ -266,7 +262,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return response;
}
// if we accelerate in the current simulation interval the ActionDistance of the next action
// changes and we might pass the ActionDistance - check again...
if (response.Acceleration <= 0) {
......@@ -292,7 +287,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
//DriverStrategy.BrakeTrigger = DriverStrategy.NextDrivingAction;
}
Log.Debug("Exceeding next ActionDistance at {0}. Reducing max Distance from {2} to {1}",
DriverStrategy.NextDrivingAction.ActionDistance, newds, ds);
return new ResponseDrivingCycleDistanceExceeded() {
......@@ -355,15 +349,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
response = Driver.DrivingActionAccelerate(absTime, ds, targetVelocity, gradient);
}
response.Switch().
Case<ResponseGearShift>(() => {
response = Driver.DrivingActionRoll(absTime, ds, velocity, gradient);
response.Switch().
Case<ResponseUnderload>(() => {
// overload may happen if driver limits acceleration when rolling downhill
response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient);
}).
Case<ResponseSpeedLimitExceeded>(() => { response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); });
}).
Case<ResponseUnderload>(r => {
if (DriverStrategy.OverspeedAllowed(gradient, targetVelocity)) {
response = Driver.DrivingActionCoast(absTime, ds, velocity, gradient);
......@@ -374,6 +359,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient);
}
});
response.Switch().
Case<ResponseGearShift>(r => {
response = Driver.DrivingActionRoll(absTime, ds, velocity, gradient);
response.Switch().
Case<ResponseUnderload>(() => {
// overload may happen if driver limits acceleration when rolling downhill
response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient);
}).
Case<ResponseSpeedLimitExceeded>(() => { response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); });
});
} else {
if (DataBus.VehicleSpeed.IsSmallerOrEqual(0.SI<MeterPerSecond>())) {
// the clutch is disengaged, and the vehicle stopped - we can't perform a roll action. wait for the clutch to be engaged
......
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