From 0dbfb00e18024b926edbb691ba42870de67e76d5 Mon Sep 17 00:00:00 2001 From: Michael Krisper <michael.krisper@tugraz.at> Date: Tue, 26 Apr 2016 15:00:22 +0200 Subject: [PATCH] downgraded some warning to infos, changed rounding-tolerance of some aux-tests --- .../IntegrationTests/AuxDemandTest.vb | 2 +- .../SimulationComponent/Impl/DefaultDriverStrategy.cs | 10 +++++----- .../Models/SimulationComponent/Impl/Driver.cs | 4 ++-- VectoCore/VectoCore/Utils/SearchAlgorithm.cs | 2 +- .../Integration/BusAuxiliaries/BusAdapterTest.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb b/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb index f8509b5e7f..f22dc7e58f 100644 --- a/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb +++ b/VECTOAux/VectoAuxiliariesTests/IntegrationTests/AuxDemandTest.vb @@ -48,7 +48,7 @@ Namespace IntegrationTests Dim power As Single = aux.AuxiliaryPowerAtCrankWatts - Assert.AreEqual(expectedPowerDemand, power, 0.0001) + Assert.AreEqual(expectedPowerDemand, power, 0.001) End Sub <Test> diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index 4016ff9f52..b0bb6295c7 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -557,7 +557,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Debug("Phase: BRAKE. breaking distance: {0} start braking @ {1}", brakingDistance, DriverStrategy.BrakeTrigger.TriggerDistance - brakingDistance); if (DriverStrategy.BrakeTrigger.TriggerDistance - brakingDistance < currentDistance) { - Log.Warn("Expected Braking Deceleration could not be reached! {0}", + Log.Info("Expected Braking Deceleration could not be reached! {0}", DriverStrategy.BrakeTrigger.TriggerDistance - brakingDistance - currentDistance); } var targetDistance = DataBus.VehicleSpeed < Constants.SimulationSettings.MinVelocityForCoast @@ -571,16 +571,16 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl gradient, targetDistance: targetDistance); response.Switch(). Case<ResponseOverload>(r => { - Log.Warn("Got OverloadResponse during brake action - desired deceleration could not be reached! response: {0}", r); + Log.Info("Got OverloadResponse during brake action - desired deceleration could not be reached! response: {0}", r); if (!DataBus.ClutchClosed(absTime)) { - Log.Warn("Clutch is open - trying RollAction"); + Log.Info("Clutch is open - trying RollAction"); response = Driver.DrivingActionRoll(absTime, ds, targetVelocity, gradient); } else { - Log.Warn("Clutch is closed - trying AccelerateAction"); + Log.Info("Clutch is closed - trying AccelerateAction"); response = Driver.DrivingActionAccelerate(absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed, gradient); response.Switch().Case<ResponseGearShift>( rs => { - Log.Warn("Got GearShift response, performing roll action..."); + Log.Info("Got GearShift response, performing roll action..."); response = Driver.DrivingActionRoll(absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed, gradient); } ); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 8ca89e3e59..6aca5126b2 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -195,7 +195,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Case<ResponseOverload>(() => { // deceleration is limited by driver model, operating point moves above full load (e.g., steep uphill) // the vehicle/driver can't achieve an acceleration higher than deceleration curve, try again with higher deceleration - Log.Warn( + Log.Info( "Operating point with limited acceleration resulted in an overload! trying again with original acceleration {0}", nextOperatingPoint.Acceleration); retVal = NextComponent.Request(absTime, nextOperatingPoint.SimulationInterval, nextOperatingPoint.Acceleration, @@ -588,7 +588,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if ( !retVal.Acceleration.IsBetween(DriverData.AccelerationCurve.MaxDeceleration(), DriverData.AccelerationCurve.MaxAcceleration())) { - Log.Warn("Operating Point outside driver acceleration limits: a: {0}", retVal.Acceleration); + Log.Info("Operating Point outside driver acceleration limits: a: {0}", retVal.Acceleration); } return ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance); diff --git a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs index d752b620bf..cfedec5064 100644 --- a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs +++ b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs @@ -72,7 +72,7 @@ namespace TUGraz.VectoCore.Utils result = InterpolateLinear(x, y, interval, getYValue, evaluateFunction, criterion, ref iterationCount); } catch (VectoException ex) { var log = LogManager.GetLogger(typeof(SearchAlgorithm).FullName); - log.Warn("Falling back to LineSearch. InterpolationSearch failed: " + ex.Message); + log.Debug("Falling back to LineSearch. InterpolationSearch failed: " + ex.Message); result = LineSearch(x, y, interval, getYValue, evaluateFunction, criterion, ref iterationCount); } return result; diff --git a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs index 1a2ccc4edf..e9a82a5720 100644 --- a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/BusAdapterTest.cs @@ -86,7 +86,7 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries var torque = busAux.PowerDemand(0.SI<Second>(), 1.SI<Second>(), engineDrivelinePower / engineSpeed, (internalPower * 1000).SI<Watt>() / engineSpeed, engineSpeed); - Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-4); + Assert.AreEqual(expectedPowerDemand, (torque * engineSpeed).Value(), 1e-3); } } } \ No newline at end of file -- GitLab