diff --git a/VectoCore/FileIO/Reader/DataObjectAdaper/AbstractSimulationDataAdapter.cs b/VectoCore/FileIO/Reader/DataObjectAdaper/AbstractSimulationDataAdapter.cs index e81207e898da2bb807eae563b780ae38757ee7a5..f9e94ff463c68ea784013cb1f8dbe346cb12bc51 100644 --- a/VectoCore/FileIO/Reader/DataObjectAdaper/AbstractSimulationDataAdapter.cs +++ b/VectoCore/FileIO/Reader/DataObjectAdaper/AbstractSimulationDataAdapter.cs @@ -38,7 +38,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper Rim = data.RimStr, }; - var retarder = new RetarderData() { + var retarder = new RetarderData { Type = (RetarderData.RetarderType)Enum.Parse(typeof(RetarderData.RetarderType), data.Retarder.TypeStr.ToString(), true), }; @@ -53,7 +53,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper internal CombustionEngineData SetCommonCombustionEngineData(EngineFileV3Declaration.DataBodyDecl data, string basePath) { - var retVal = new CombustionEngineData() { + var retVal = new CombustionEngineData { SavedInDeclarationMode = data.SavedInDeclarationMode, ModelName = data.ModelName, Displacement = data.Displacement.SI().Cubic.Centi.Meter.Cast<CubicMeter>(), // convert vom ccm to m^3 @@ -68,7 +68,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper internal GearboxData SetCommonGearboxData(GearboxFileV5Declaration.DataBodyDecl data) { - return new GearboxData() { + return new GearboxData { SavedInDeclarationMode = data.SavedInDeclarationMode, ModelName = data.ModelName, Type = data.GearboxType.Parse<GearboxType>() diff --git a/VectoCore/FileIO/Reader/DataObjectAdaper/DeclarationDataAdapter.cs b/VectoCore/FileIO/Reader/DataObjectAdaper/DeclarationDataAdapter.cs index ae114df735868ab47b16a2ca801a44f1a12b6718..0423fc159a8287af5a1bf860a8b728dfe1a120d8 100644 --- a/VectoCore/FileIO/Reader/DataObjectAdaper/DeclarationDataAdapter.cs +++ b/VectoCore/FileIO/Reader/DataObjectAdaper/DeclarationDataAdapter.cs @@ -67,12 +67,12 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper { var data = job.Body; - var lookAheadData = new DriverData.LACData() { + var lookAheadData = new DriverData.LACData { Enabled = DeclarationData.Driver.LookAhead.Enabled, Deceleration = DeclarationData.Driver.LookAhead.Deceleration, MinSpeed = DeclarationData.Driver.LookAhead.MinimumSpeed }; - var overspeedData = new DriverData.OverSpeedEcoRollData() { + var overspeedData = new DriverData.OverSpeedEcoRollData { Mode = DriverData.ParseDriverMode(data.OverSpeedEcoRoll.Mode), MinSpeed = DeclarationData.Driver.OverSpeedEcoRoll.MinSpeed, OverSpeed = DeclarationData.Driver.OverSpeedEcoRoll.OverSpeed, @@ -82,13 +82,13 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper throw new VectoSimulationException( string.Format("Specified Overspeed/EcoRoll Mode not allowed in declaration mode! {0}", overspeedData.Mode)); } - var startstopData = new VectoRunData.StartStopData() { + var startstopData = new VectoRunData.StartStopData { Enabled = data.StartStop.Enabled, Delay = DeclarationData.Driver.StartStop.Delay, MinTime = DeclarationData.Driver.StartStop.MinTime, MaxSpeed = DeclarationData.Driver.StartStop.MaxSpeed, }; - var retVal = new DriverData() { + var retVal = new DriverData { LookAheadCoasting = lookAheadData, OverSpeedEcoRoll = overspeedData, StartStop = startstopData, @@ -130,7 +130,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper } foreach (var tmp in mission.TrailerAxleWeightDistribution) { - retVal.AxleData.Add(new Axle() { + retVal.AxleData.Add(new Axle { AxleWeightShare = tmp, TwinTyres = DeclarationData.Trailer.TwinTyres, RollResistanceCoefficient = DeclarationData.Trailer.RollResistanceCoefficient, diff --git a/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs b/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs index b06fc0d949ae2e549a5afcec2fb45f7fb7700309..9c1d9d275ae9810c210d2c4b79c1316a908161d2 100644 --- a/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs +++ b/VectoCore/FileIO/Reader/DataObjectAdaper/EngineeringDataAdapter.cs @@ -66,24 +66,24 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper var data = job.Body; var accelerationData = AccelerationCurveData.ReadFromFile(Path.Combine(job.BasePath, data.AccelerationCurve)); - var lookAheadData = new DriverData.LACData() { + var lookAheadData = new DriverData.LACData { Enabled = data.LookAheadCoasting.Enabled, Deceleration = data.LookAheadCoasting.Dec.SI<MeterPerSquareSecond>(), MinSpeed = data.LookAheadCoasting.MinSpeed.KMPHtoMeterPerSecond(), }; - var overspeedData = new DriverData.OverSpeedEcoRollData() { + var overspeedData = new DriverData.OverSpeedEcoRollData { Mode = DriverData.ParseDriverMode(data.OverSpeedEcoRoll.Mode), MinSpeed = data.OverSpeedEcoRoll.MinSpeed.KMPHtoMeterPerSecond(), OverSpeed = data.OverSpeedEcoRoll.OverSpeed.KMPHtoMeterPerSecond(), UnderSpeed = data.OverSpeedEcoRoll.UnderSpeed.KMPHtoMeterPerSecond(), }; - var startstopData = new VectoRunData.StartStopData() { + var startstopData = new VectoRunData.StartStopData { Enabled = data.StartStop.Enabled, Delay = data.StartStop.Delay.SI<Second>(), MinTime = data.StartStop.MinTime.SI<Second>(), MaxSpeed = data.StartStop.MaxSpeed.KMPHtoMeterPerSecond(), }; - var retVal = new DriverData() { + var retVal = new DriverData { AccelerationCurve = accelerationData, LookAheadCoasting = lookAheadData, OverSpeedEcoRoll = overspeedData, @@ -173,7 +173,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.DataObjectAdaper ? FullLoadCurve.ReadFromFile(Path.Combine(gearbox.BasePath, gearSettings.FullLoadCurve)) : null; - var gear = new GearData() { + var gear = new GearData { LossMap = lossMap, ShiftPolygon = shiftPolygon, FullLoadCurve = fullLoad, diff --git a/VectoCore/FileIO/Reader/Impl/EngineOnlySimulationDataReader.cs b/VectoCore/FileIO/Reader/Impl/EngineOnlySimulationDataReader.cs index 1bdf919b3f6ed4487b2c10999257fa48521ee235..98d4da2d5e8ba7073ca1de354f0b82196f5b8bec 100644 --- a/VectoCore/FileIO/Reader/Impl/EngineOnlySimulationDataReader.cs +++ b/VectoCore/FileIO/Reader/Impl/EngineOnlySimulationDataReader.cs @@ -23,7 +23,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.Impl } var dao = new EngineeringDataAdapter(); foreach (var cycle in job.Body.Cycles) { - var simulationRunData = new VectoRunData() { + var simulationRunData = new VectoRunData { BasePath = job.BasePath, JobFileName = job.JobFile, EngineData = dao.CreateEngineData(Engine), diff --git a/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs b/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs index 757dae0e047b1a33671fd158dee6d5f7c00b0d44..cc7f594e52c95ac88c92b8aa912762231b00c977 100644 --- a/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs +++ b/VectoCore/FileIO/Reader/Impl/EngineeringModeSimulationDataReader.cs @@ -99,7 +99,7 @@ namespace TUGraz.VectoCore.FileIO.Reader.Impl var dao = new EngineeringDataAdapter(); var driver = dao.CreateDriverData(job); foreach (var cycle in job.Body.Cycles) { - var simulationRunData = new VectoRunData() { + var simulationRunData = new VectoRunData { BasePath = job.BasePath, JobFileName = job.JobFile, EngineData = dao.CreateEngineData(Engine), diff --git a/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 38f25a489925012872b19e3d6814d3510b9ccd24..e6019db04fb6abe478335f65e6ce2ca73c2697ef 100644 --- a/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -97,7 +97,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl _currentState.EnginePower = LimitEnginePower(requestedEnginePower); if (dryRun) { - return new ResponseDryRun() { + return new ResponseDryRun { EngineDeltaFullLoad = (requestedEnginePower - _currentState.DynamicFullLoadPower), EngineDeltaDragLoad = (requestedEnginePower - _currentState.FullDragPower), EnginePowerRequest = requestedEnginePower @@ -105,7 +105,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } if (!_currentState.EnginePower.IsEqual(requestedEnginePower, Constants.SimulationSettings.EngineFLDPowerTolerance)) { - return new ResponseFailOverload() { + return new ResponseFailOverload { Delta = (requestedEnginePower - _currentState.EnginePower), EnginePowerRequest = requestedEnginePower }; @@ -117,7 +117,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl _currentState.EngineTorque = Formulas.PowerToTorque(_currentState.EnginePower, _currentState.EngineSpeed); - return new ResponseSuccess() { EnginePowerRequest = requestedEnginePower }; + return new ResponseSuccess { EnginePowerRequest = requestedEnginePower }; } protected void ComputeRequestedEnginePower(Second absTime, Second dt, NewtonMeter torque, PerSecond engineSpeed, @@ -142,7 +142,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse Initialize(NewtonMeter torque, PerSecond engineSpeed) { - _previousState = new EngineState() { + _previousState = new EngineState { EngineSpeed = engineSpeed, dt = 1.SI<Second>(), EnginePowerLoss = 0.SI<Watt>(), diff --git a/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs b/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs index 9e12cc3ce3b52ef3ba101b786391085e59fe3982..9c6c0b5456e3b4919f3c89f23183e64f4e98b890 100644 --- a/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs +++ b/VectoCore/Models/SimulationComponent/Impl/DistanceBasedDrivingCycle.cs @@ -98,7 +98,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (PreviousState.Distance + ds > CycleIntervalIterator.RightSample.Distance) { // only drive until next sample point in cycle // only drive until next sample point in cycle - return new ResponseDrivingCycleDistanceExceeded() { + return new ResponseDrivingCycleDistanceExceeded { MaxDistance = CycleIntervalIterator.RightSample.Distance - PreviousState.Distance }; } @@ -122,7 +122,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl (CycleIntervalIterator.RightSample.Distance - PreviousState.Distance) < Constants.SimulationSettings.DriveOffDistance) { CurrentState.RequestToNextSamplePointDone = true; - return new ResponseDrivingCycleDistanceExceeded() { MaxDistance = Constants.SimulationSettings.DriveOffDistance }; + return new ResponseDrivingCycleDistanceExceeded { MaxDistance = Constants.SimulationSettings.DriveOffDistance }; } CurrentState.Distance = PreviousState.Distance + ds; CurrentState.VehicleTargetSpeed = CycleIntervalIterator.LeftSample.VehicleTargetSpeed; @@ -157,7 +157,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl IResponse ISimulationOutPort.Initialize() { var first = Data.Entries.First(); - PreviousState = new DrivingCycleState() { + PreviousState = new DrivingCycleState { AbsTime = 0.SI<Second>(), WaitTime = 0.SI<Second>(), Distance = first.Distance, @@ -310,7 +310,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public DrivingCycleState Clone() { - return new DrivingCycleState() { + return new DrivingCycleState { AbsTime = AbsTime, Distance = Distance, VehicleTargetSpeed = VehicleTargetSpeed, diff --git a/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 0627a8439256d43da0093e36b037833b229232d1..e2cf3028f757a6623a58e5bfbbd0922ccbda005f 100644 --- a/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -133,7 +133,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.DebugFormat( "current Distance: {3} -- Simulation Distance {0} exceeds next DrivingAction at {1}, reducing interval to {2}", ds, nextDrivingAction.Current.Key, nextDrivingAction.Current.Key - currentDistance, currentDistance); - return new ResponseDrivingCycleDistanceExceeded() { MaxDistance = nextDrivingAction.Current.Key - currentDistance }; + return new ResponseDrivingCycleDistanceExceeded { MaxDistance = nextDrivingAction.Current.Key - currentDistance }; } } else { if (targetVelocity > DataBus.VehicleSpeed()) { @@ -183,7 +183,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.DebugFormat( "SearchOperatingPoint Breaking reduced the max. distance: {0} -> {1}. Issue new request from driving cycle!", newDs, ds); - return new ResponseDrivingCycleDistanceExceeded() { MaxDistance = newDs, SimulationInterval = CurrentState.dt }; + return new ResponseDrivingCycleDistanceExceeded { MaxDistance = newDs, SimulationInterval = CurrentState.dt }; } Log.DebugFormat("Found operating point for breaking. dt: {0}, acceleration: {1}", CurrentState.dt, @@ -274,7 +274,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } } while (CurrentState.RetryCount++ < Constants.SimulationSettings.DriverSearchLoopThreshold); - return new ResponseDrivingCycleDistanceExceeded() { SimulationInterval = CurrentState.dt }; + return new ResponseDrivingCycleDistanceExceeded { SimulationInterval = CurrentState.dt }; } protected List<KeyValuePair<Meter, DrivingBehaviorEntry>> GetNextDrivingActions(Meter minDistance) @@ -297,7 +297,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl breakingDistance); Log.DebugFormat("adding 'Braking' starting at distance {0}", entry.Distance - breakingDistance); nextActions.Add(new KeyValuePair<Meter, DrivingBehaviorEntry>(entry.Distance - breakingDistance, - new DrivingBehaviorEntry() { + new DrivingBehaviorEntry { Action = DrivingBehavior.Breaking, ActionDistance = entry.Distance - breakingDistance, TriggerDistance = entry.Distance, @@ -307,7 +307,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl DeclarationData.Driver.LookAhead.Deceleration); Log.DebugFormat("adding 'Coasting' starting at distance {0}", entry.Distance - coastingDistance); nextActions.Add(new KeyValuePair<Meter, DrivingBehaviorEntry>(entry.Distance - coastingDistance, - new DrivingBehaviorEntry() { + new DrivingBehaviorEntry { Action = DrivingBehavior.Coasting, ActionDistance = entry.Distance - coastingDistance, TriggerDistance = entry.Distance, @@ -315,7 +315,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl })); } if (entry.VehicleTargetSpeed > currentSpeed) { - nextActions.Add(new KeyValuePair<Meter, DrivingBehaviorEntry>(entry.Distance, new DrivingBehaviorEntry() { + nextActions.Add(new KeyValuePair<Meter, DrivingBehaviorEntry>(entry.Distance, new DrivingBehaviorEntry { Action = DrivingBehavior.Accelerating, NextTargetSpeed = entry.VehicleTargetSpeed, TriggerDistance = entry.Distance, @@ -356,7 +356,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl if (!ds.IsEqual(newDs)) { Log.DebugFormat( "SearchOperatingPoint reduced the max. distance: {0} -> {1}. Issue new request from driving cycle!", newDs, ds); - return new ResponseDrivingCycleDistanceExceeded() { MaxDistance = newDs, SimulationInterval = CurrentState.dt }; + return new ResponseDrivingCycleDistanceExceeded { MaxDistance = newDs, SimulationInterval = CurrentState.dt }; } Log.DebugFormat("Found operating point for coasting. dt: {0}, acceleration: {1}", CurrentState.dt, diff --git a/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs b/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs index 6daee37b5af079d510138ab0ecb5db6b4c7d6b70..2dfea899927deb9df9c43b7ff3ddb27a86c67fcf 100644 --- a/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs +++ b/VectoCore/Models/SimulationComponent/Impl/EngineOnlyCombustionEngine.cs @@ -30,7 +30,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl _currentState.EnginePower = LimitEnginePower(requestedEnginePower); if (dryRun) { - return new ResponseDryRun() { + return new ResponseDryRun { EngineDeltaFullLoad = (requestedEnginePower - _currentState.DynamicFullLoadPower), EngineDeltaDragLoad = (requestedEnginePower - _currentState.FullDragPower) }; diff --git a/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs b/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs index 90c340d38a2cf60715a647361e35a27ffa356cda..d69ab8111971197f220ac8552720714a22627cab 100644 --- a/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs +++ b/VectoCore/Models/SimulationComponent/Impl/Vehicle.cs @@ -22,8 +22,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public Vehicle(VehicleContainer container, VehicleData data) : base(container) { _data = data; - _previousState = new VehicleState() { Distance = 0.SI<Meter>(), Velocity = 0.SI<MeterPerSecond>() }; - _currentState = new VehicleState() { Distance = 0.SI<Meter>(), Velocity = 0.SI<MeterPerSecond>() }; + _previousState = new VehicleState { Distance = 0.SI<Meter>(), Velocity = 0.SI<MeterPerSecond>() }; + _currentState = new VehicleState { Distance = 0.SI<Meter>(), Velocity = 0.SI<MeterPerSecond>() }; } public Vehicle(VehicleContainer container, VehicleData data, double initialVelocity) : this(container, data) @@ -81,8 +81,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse Initialize(MeterPerSecond vehicleSpeed, Radian roadGradient) { - _previousState = new VehicleState() { Distance = 0.SI<Meter>(), Velocity = vehicleSpeed }; - _currentState = new VehicleState() { Distance = 0.SI<Meter>(), Velocity = vehicleSpeed }; + _previousState = new VehicleState { Distance = 0.SI<Meter>(), Velocity = vehicleSpeed }; + _currentState = new VehicleState { Distance = 0.SI<Meter>(), Velocity = vehicleSpeed }; var vehicleAccelerationForce = RollingResistance(roadGradient) + AirDragResistance() + SlopeResistance(roadGradient); return _nextInstance.Initialize(vehicleAccelerationForce, vehicleSpeed); diff --git a/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs b/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs index c2b6ae31ed66748d5c9968380244073c1687734c..71be19e5e0eb624390dfad1635e1e4ed2930e37f 100644 --- a/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs +++ b/VectoCoreTest/Integration/SimulationRuns/MinimalPowertrain.cs @@ -229,7 +229,7 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns private static GearData CreateAxleGearData() { - return new GearData() { + return new GearData { Ratio = 3.0 * 3.5, LossMap = TransmissionLossMap.ReadFromFile(GbxLossMap, 3.0 * 3.5) }; @@ -238,22 +238,22 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns private static VehicleData CreateVehicleData(Kilogram loading) { - var axles = new List<Axle>() { - new Axle() { + var axles = new List<Axle> { + new Axle { AxleWeightShare = 0.4375, Inertia = 21.66667.SI<KilogramSquareMeter>(), RollResistanceCoefficient = 0.0055, TwinTyres = false, TyreTestLoad = 62538.75.SI<Newton>() }, - new Axle() { + new Axle { AxleWeightShare = 0.375, Inertia = 10.83333.SI<KilogramSquareMeter>(), RollResistanceCoefficient = 0.0065, TwinTyres = true, TyreTestLoad = 52532.55.SI<Newton>() }, - new Axle() { + new Axle { AxleWeightShare = 0.1875, Inertia = 21.66667.SI<KilogramSquareMeter>(), RollResistanceCoefficient = 0.0055, @@ -261,7 +261,7 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns TyreTestLoad = 62538.75.SI<Newton>() } }; - return new VehicleData() { + return new VehicleData { AxleConfiguration = AxleConfiguration.AxleConfig_6x2, CrossSectionArea = 3.2634.SI<SquareMeter>(), CrossWindCorrectionMode = CrossWindCorrectionMode.NoCorrection, @@ -270,7 +270,7 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), - Retarder = new RetarderData() { Type = RetarderData.RetarderType.None }, + Retarder = new RetarderData { Type = RetarderData.RetarderType.None }, AxleData = axles, SavedInDeclarationMode = false, }; @@ -278,15 +278,15 @@ namespace TUGraz.VectoCore.Tests.Integration.SimulationRuns private static DriverData CreateDriverData(string accelerationFile) { - return new DriverData() { + return new DriverData { AccelerationCurve = AccelerationCurveData.ReadFromFile(accelerationFile), - LookAheadCoasting = new DriverData.LACData() { + LookAheadCoasting = new DriverData.LACData { Enabled = false, }, - OverSpeedEcoRoll = new DriverData.OverSpeedEcoRollData() { + OverSpeedEcoRoll = new DriverData.OverSpeedEcoRollData { Mode = VectoCore.Models.SimulationComponent.Data.DriverData.DriverMode.Off }, - StartStop = new VectoRunData.StartStopData() { + StartStop = new VectoRunData.StartStopData { Enabled = false, } }; diff --git a/VectoCoreTest/Models/SimulationComponent/DriverTest.cs b/VectoCoreTest/Models/SimulationComponent/DriverTest.cs index c97a8c513663f650e85d75bfd5fc6169f5dd3526..9a9d2e7de813ec9bc6a69a3e6c5a849b7de8d67a 100644 --- a/VectoCoreTest/Models/SimulationComponent/DriverTest.cs +++ b/VectoCoreTest/Models/SimulationComponent/DriverTest.cs @@ -332,22 +332,22 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent private static VehicleData CreateVehicleData(Kilogram loading) { - var axles = new List<Axle>() { - new Axle() { + var axles = new List<Axle> { + new Axle { AxleWeightShare = 0.4375, Inertia = 21.66667.SI<KilogramSquareMeter>(), RollResistanceCoefficient = 0.0055, TwinTyres = false, TyreTestLoad = 62538.75.SI<Newton>() }, - new Axle() { + new Axle { AxleWeightShare = 0.375, Inertia = 10.83333.SI<KilogramSquareMeter>(), RollResistanceCoefficient = 0.0065, TwinTyres = false, TyreTestLoad = 52532.55.SI<Newton>() }, - new Axle() { + new Axle { AxleWeightShare = 0.1875, Inertia = 21.66667.SI<KilogramSquareMeter>(), RollResistanceCoefficient = 0.0055, @@ -355,7 +355,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent TyreTestLoad = 62538.75.SI<Newton>() } }; - return new VehicleData() { + return new VehicleData { AxleConfiguration = AxleConfiguration.AxleConfig_4x2, CrossSectionArea = 3.2634.SI<SquareMeter>(), CrossWindCorrectionMode = CrossWindCorrectionMode.NoCorrection, @@ -364,7 +364,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent CurbWeigthExtra = 0.SI<Kilogram>(), Loading = loading, DynamicTyreRadius = 0.52.SI<Meter>(), - Retarder = new RetarderData() { Type = RetarderData.RetarderType.None }, + Retarder = new RetarderData { Type = RetarderData.RetarderType.None }, AxleData = axles, SavedInDeclarationMode = false, }; @@ -372,15 +372,15 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent private static DriverData CreateDriverData() { - return new DriverData() { + return new DriverData { AccelerationCurve = AccelerationCurveData.ReadFromFile(AccelerationFile), - LookAheadCoasting = new DriverData.LACData() { + LookAheadCoasting = new DriverData.LACData { Enabled = false, }, - OverSpeedEcoRoll = new DriverData.OverSpeedEcoRollData() { + OverSpeedEcoRoll = new DriverData.OverSpeedEcoRollData { Mode = VectoCore.Models.SimulationComponent.Data.DriverData.DriverMode.Off }, - StartStop = new VectoRunData.StartStopData() { + StartStop = new VectoRunData.StartStopData { Enabled = false, } }; diff --git a/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs b/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs index e554a57921b69771e2f4e5d82f071ada2b6165a8..73153088c02fbbe0d40ed64e5e9d600f8f9e912d 100644 --- a/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs +++ b/VectoCoreTest/Models/SimulationComponentData/FullLoadCurveTest.cs @@ -76,7 +76,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData public void TestPreferredSpeed() { var fldCurve = EngineFullLoadCurve.ReadFromFile(CoachEngineFLD); - fldCurve.EngineData = new CombustionEngineData() { IdleSpeed = 560.RPMtoRad() }; + fldCurve.EngineData = new CombustionEngineData { IdleSpeed = 560.RPMtoRad() }; AssertHelper.AreRelativeEqual(130.691151551712.SI<PerSecond>(), fldCurve.PreferredSpeed); AssertHelper.AreRelativeEqual(194.515816596908.SI<PerSecond>(), fldCurve.N95hSpeed); AssertHelper.AreRelativeEqual(94.2463966015023.SI<PerSecond>(), fldCurve.LoSpeed); diff --git a/VectoCoreTest/Utils/MockAuxiliaryDemand.cs b/VectoCoreTest/Utils/MockAuxiliaryDemand.cs index 805fd6b02d5234d9efa53084280c83e91b12b7ae..a4595e2612fda75342658c5d918988ec69404595 100644 --- a/VectoCoreTest/Utils/MockAuxiliaryDemand.cs +++ b/VectoCoreTest/Utils/MockAuxiliaryDemand.cs @@ -24,7 +24,7 @@ namespace TUGraz.VectoCore.Tests.Utils public CycleData CycleData() { - return new CycleData() { + return new CycleData { AbsTime = 0.SI<Second>(), AbsDistance = 0.SI<Meter>(), LeftSample = _left.Current, diff --git a/VectoCoreTest/Utils/MockDriver.cs b/VectoCoreTest/Utils/MockDriver.cs index ca9375ec7e0761a92fdde872aac52ca3f12875b4..129324fc5db78b87094f6c1e4d9bd7e16b9e420a 100644 --- a/VectoCoreTest/Utils/MockDriver.cs +++ b/VectoCoreTest/Utils/MockDriver.cs @@ -36,18 +36,18 @@ namespace TUGraz.VectoCore.Tests.Utils public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient) { - LastRequest = new RequestData() { AbsTime = absTime, ds = ds, Gradient = gradient, TargetVelocity = targetVelocity }; + LastRequest = new RequestData { AbsTime = absTime, ds = ds, Gradient = gradient, TargetVelocity = targetVelocity }; var acc = 0.SI<MeterPerSquareSecond>(); var dt = 1.SI<Second>(); - return new ResponseSuccess() { SimulationInterval = dt }; + return new ResponseSuccess { SimulationInterval = dt }; //_next.Request(absTime, TimeSpan.FromSeconds(0), acc, 0.SI<Radian>()); } public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient) { - LastRequest = new RequestData() { AbsTime = absTime, dt = dt, Gradient = gradient, TargetVelocity = targetVelocity }; + LastRequest = new RequestData { AbsTime = absTime, dt = dt, Gradient = gradient, TargetVelocity = targetVelocity }; var acc = 0.SI<MeterPerSquareSecond>(); - return new ResponseSuccess() { SimulationInterval = dt }; //_next.Request(absTime, dt, acc, gradient); + return new ResponseSuccess { SimulationInterval = dt }; //_next.Request(absTime, dt, acc, gradient); } public IResponse Initialize(MeterPerSecond vehicleSpeed, Radian roadGradient) diff --git a/VectoCoreTest/Utils/MockVehicle.cs b/VectoCoreTest/Utils/MockVehicle.cs index 3d8e469c24fb132b1757e835369cafb8217065da..a7fb29e08903366a1ab09e2d39bdd607432466b2 100644 --- a/VectoCoreTest/Utils/MockVehicle.cs +++ b/VectoCoreTest/Utils/MockVehicle.cs @@ -58,7 +58,7 @@ namespace TUGraz.VectoCore.Tests.Utils public IResponse Request(Second absTime, Second dt, MeterPerSquareSecond acceleration, Radian gradient, bool b) { - LastRequest = new RequestData() { + LastRequest = new RequestData { abstime = absTime, dt = dt, acceleration = acceleration,