diff --git a/Generic Vehicles/Declaration Mode/12t Delivery Truck/12t Delivery Truck.vsum b/Generic Vehicles/Declaration Mode/12t Delivery Truck/12t Delivery Truck.vsum deleted file mode 100644 index fd4d9a5bc0e942d3080f5f245f9f827e387458e2..0000000000000000000000000000000000000000 --- a/Generic Vehicles/Declaration Mode/12t Delivery Truck/12t Delivery Truck.vsum +++ /dev/null @@ -1,10 +0,0 @@ -Job [-],Input File [-],Cycle [-],Status,Mass [kg],Loading [kg],time [s],distance [km],speed [km/h],altitudeDelta [m],FC-Map [g/h],FC-Map [g/km],FC-AUXc [g/h],FC-AUXc [g/km],FC-WHTCc [g/h],FC-WHTCc [g/km],FC-AAUX [g/h],FC-AAUX [g/km],FC-Final [g/h],FC-Final [g/km],FC-Final [l/100km],FC-Final [l/100tkm],CO2 [g/km],CO2 [g/tkm],P_wheel_in_pos [kW],P_brake_loss [kW],P_eng_out_pos [kW],P_eng_out_neg [kW],E_aux_FAN [kWh],E_aux_STP [kWh],E_aux_AC [kWh],E_aux_PS [kWh],E_aux_ES [kWh],E_aux_sum [kWh],E_air [kWh],E_roll [kWh],E_grad [kWh],E_inertia [kWh],E_brake [kWh],E_gbx_axl_loss [kWh],E_ret_loss [kWh],E_tc_loss [kWh],E_eng_out_pos [kWh],E_eng_out_neg [kWh],a [m/s^2],a_pos [m/s^2],a_neg [m/s^2],AccelerationTimeShare [%],DecelerationTimeShare [%],CruiseTimeShare [%],StopTimeShare [%] -2-0,12t Delivery Truck,LongHaul.vdri,Success,7750.0000,0.0000,4544.7743,100.1850,79.3584,-2.5494,14928.1995,188.1112,14928.1995,188.1112,15044.6394,189.5784,15044.6394,189.5784,15044.6394,189.5784,22.7859,,599.0678,,57.9544,0.8532,75.6554,-16.3708,0.8435,0.4672,0.2525,1.4900,2.2368,5.2901,50.6334,20.0004,-0.0512,0.0000,1.0772,15.9289,0.0000,0.0000,88.4933,-0.8804,0.0000,0.4627,-0.4662,4.3794,4.3134,0.0000,1.4742 -2-1,12t Delivery Truck,LongHaul.vdri,Success,7750.0000,4150.0000,4574.5666,100.1850,78.8416,-2.5494,16547.5682,209.8838,16547.5682,209.8838,16676.6392,211.5209,16676.6392,211.5209,16676.6392,211.5209,25.4232,6.1261,668.4060,161.0617,66.6100,2.4444,86.0351,-15.8558,0.8490,0.4703,0.2542,1.4998,2.2515,5.3247,50.3756,29.4211,-0.0786,0.0000,3.1061,16.1961,0.0000,0.0000,100.0772,-1.0250,0.0000,0.4200,-0.4759,4.6568,4.0446,0.0000,1.4646 -2-2,12t Delivery Truck,LongHaul.vdri,Success,7750.0000,4150.0000,4574.5666,100.1850,78.8416,-2.5494,16547.5682,209.8838,16547.5682,209.8838,16676.6392,211.5209,16676.6392,211.5209,16676.6392,211.5209,25.4232,6.1261,668.4060,161.0617,66.6100,2.4444,86.0351,-15.8558,0.8490,0.4703,0.2542,1.4998,2.2515,5.3247,50.3756,29.4211,-0.0786,0.0000,3.1061,16.1961,0.0000,0.0000,100.0772,-1.0250,0.0000,0.4200,-0.4759,4.6568,4.0446,0.0000,1.4646 -2-3,12t Delivery Truck,RegionalDelivery.vdri,Success,7750.0000,0.0000,1580.7711,25.8360,58.8381,0.0101,10796.3012,183.4916,10796.3012,183.4916,10802.7790,183.6017,10802.7790,183.6017,10802.7790,183.6017,22.0675,,580.1814,,40.4898,2.2577,64.7531,-8.3571,0.3167,0.1406,0.0878,0.5622,0.6620,1.7693,10.7354,5.1202,-0.0001,0.0000,0.9913,4.0827,0.0000,0.0000,21.3940,-0.4322,0.0000,0.4901,-0.5314,13.9241,12.7848,0.0000,7.2117 -2-4,12t Delivery Truck,RegionalDelivery.vdri,Success,7750.0000,2983.8900,1583.3376,25.8360,58.7427,0.0101,11907.2364,202.7014,11907.2364,202.7014,11914.3807,202.8230,11914.3807,202.8230,11914.3807,202.8230,24.3778,8.1698,640.9207,214.7937,46.7806,3.7696,75.9980,-11.2300,0.3172,0.1408,0.0880,0.5631,0.6631,1.7722,10.6922,6.8643,-0.0002,0.0000,1.6579,4.1756,0.0000,0.0000,24.1477,-0.7165,0.0000,0.4665,-0.5103,14.9810,13.4640,0.0000,7.2000 -2-5,12t Delivery Truck,RegionalDelivery.vdri,Success,7750.0000,4150.0000,1584.9491,25.8360,58.6830,0.0101,12325.0194,210.0270,12325.0194,210.0270,12332.4144,210.1530,12332.4144,210.1530,12332.4144,210.1530,25.2588,6.0865,664.0836,160.0201,49.1906,4.3746,80.4332,-11.8038,0.3175,0.1409,0.0881,0.5637,0.6637,1.7740,10.6534,7.5320,-0.0002,0.0000,1.9260,4.2116,0.0000,0.0000,25.1871,-0.8189,0.0000,0.4431,-0.4858,15.9722,14.2677,0.0000,7.1927 -2-6,12t Delivery Truck,UrbanDelivery.vdri,Aborted,7750.0000,0.0000,906.0032,4.9742,19.7651,-7.4125,4408.4726,223.0431,4408.4726,223.0431,4367.9147,220.9911,4367.9147,220.9911,4367.9147,220.9911,26.5614,,698.3320,,13.1643,5.0283,37.3407,-6.9963,0.1551,0.0781,0.0378,0.3324,0.3504,0.9537,0.5806,0.9857,-0.1559,0.0295,1.2655,0.8116,0.0000,0.0000,3.8777,-0.2921,0.0076,0.5538,-0.6160,20.9945,17.6796,0.0000,29.8428 -2-7,12t Delivery Truck,UrbanDelivery.vdri,Aborted,7750.0000,2983.8900,686.4355,4.4473,23.3240,-6.5605,5871.9648,251.7561,5871.9648,251.7561,5817.9427,249.4399,5817.9427,249.4399,5817.9427,249.4399,29.9808,10.0475,788.2302,264.1620,20.5155,9.2052,50.6685,-7.5826,0.1175,0.0592,0.0286,0.2519,0.2655,0.7227,0.5563,1.1816,-0.1911,0.0290,1.7552,0.7508,0.0000,0.0000,4.4481,-0.2784,0.0100,0.5367,-0.6031,24.2336,20.0000,0.0000,21.4150 -2-8,12t Delivery Truck,UrbanDelivery.vdri,Aborted,7750.0000,4150.0000,1995.5984,12.2235,22.0509,-7.3852,5664.0624,256.8634,5664.0624,256.8634,5611.9530,254.5002,5611.9530,254.5002,5611.9530,254.5002,30.5890,7.3708,804.2207,193.7881,19.8581,8.2179,52.3756,-8.3023,0.3416,0.1719,0.0832,0.7319,0.7715,2.1000,1.4655,3.5633,-0.2384,0.0294,4.5554,2.0750,0.0000,0.0000,12.5032,-0.8591,0.0035,0.5393,-0.5926,21.1028,18.7469,0.0000,25.9163 diff --git a/VectoCommon/VectoCommon/Models/IResponse.cs b/VectoCommon/VectoCommon/Models/IResponse.cs index 30a1afe1c4a6225db97a3d7cddbffe13149c4b52..55ff42f6288cf21a2e4641e35f2eb7cd973e1180 100644 --- a/VectoCommon/VectoCommon/Models/IResponse.cs +++ b/VectoCommon/VectoCommon/Models/IResponse.cs @@ -30,7 +30,6 @@ */ using TUGraz.VectoCommon.Utils; -using TUGraz.VectoCore.Models.SimulationComponent.Impl; namespace TUGraz.VectoCommon.Models { @@ -65,6 +64,6 @@ namespace TUGraz.VectoCommon.Models Second AbsTime { get; set; } - Driver.OperatingPoint OperatingPoint { get; set; } + OperatingPoint OperatingPoint { get; set; } } } \ No newline at end of file diff --git a/VectoCommon/VectoCommon/Models/OperatingPoint.cs b/VectoCommon/VectoCommon/Models/OperatingPoint.cs new file mode 100644 index 0000000000000000000000000000000000000000..6e9e0cdd62f3822ee124044b3cf350e5c6097eb8 --- /dev/null +++ b/VectoCommon/VectoCommon/Models/OperatingPoint.cs @@ -0,0 +1,18 @@ +using System.Diagnostics; +using TUGraz.VectoCommon.Utils; + +namespace TUGraz.VectoCommon.Models +{ + [DebuggerDisplay("a: {Acceleration}, dt: {SimulationInterval}, ds: {SimulationDistance}")] + public struct OperatingPoint + { + public MeterPerSquareSecond Acceleration; + public Meter SimulationDistance; + public Second SimulationInterval; + + public override string ToString() + { + return string.Format("a: {0}, dt: {1}, ds: {2}", Acceleration, SimulationInterval, SimulationDistance); + } + } +} \ No newline at end of file diff --git a/VectoCommon/VectoCommon/VectoCommon.csproj b/VectoCommon/VectoCommon/VectoCommon.csproj index 7ff365461a60b78d4dbcc172226c81430e8e1d47..aee18349db665a9187b59f5fc38aaf0f4311f596 100644 --- a/VectoCommon/VectoCommon/VectoCommon.csproj +++ b/VectoCommon/VectoCommon/VectoCommon.csproj @@ -56,6 +56,7 @@ <Compile Include="Models\GearboxType.cs" /> <Compile Include="Models\IResponse.cs" /> <Compile Include="Models\LoggingObject.cs" /> + <Compile Include="Models\OperatingPoint.cs" /> <Compile Include="Models\RetarderType.cs" /> <Compile Include="Models\VehicleCategory.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> diff --git a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs index 9555b7c5f3d6e6c4590bc9eb662d511206deb79f..0177c31cda0f234aa51d6ee9b56dc218e6354148 100644 --- a/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs +++ b/VectoCore/VectoCore/Models/Connector/Ports/Impl/Response.cs @@ -62,7 +62,7 @@ namespace TUGraz.VectoCore.Models.Connector.Ports.Impl public Second AbsTime { get; set; } - public Driver.OperatingPoint OperatingPoint { get; set; } + public OperatingPoint OperatingPoint { get; set; } public PerSecond EngineSpeed { get; set; } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/DistanceRun.cs b/VectoCore/VectoCore/Models/Simulation/Impl/DistanceRun.cs index 37cf822ed2ed4590396fdee4c92c94613127b989..da5dc761a03bf8698a83fd0cb022a2e750810d4c 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/DistanceRun.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/DistanceRun.cs @@ -44,6 +44,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl protected override IResponse DoSimulationStep() { + IterationStatistics.StartIteration(); + // estimate distance to be traveled within the next TargetTimeInterval var ds = Container.VehicleSpeed.IsEqual(0) ? Constants.SimulationSettings.DriveOffDistance @@ -52,6 +54,8 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl var loopCount = 0; IResponse response; do { + IterationStatistics.Increment(this, "Iterations"); + Container.BrakePower = 0.SI<Watt>(); response = CyclePort.Request(AbsTime, ds); response.Switch(). @@ -72,6 +76,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } } while (!(response is ResponseSuccess || response is ResponseCycleFinished)); + IterationStatistics.Increment(this, "Distance", Container.Distance.Value()); + IterationStatistics.Increment(this, "Time", AbsTime.Value()); + IterationStatistics.FinishIteration(AbsTime); return response; } diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs b/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs index a1282979aed6ca9db29d8a6bbeb63e54509594ce..cb5ec81dba04918daacb8c87a4183f36785bdc74 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/VectoRun.cs @@ -145,6 +145,9 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl } Container.RunStatus = Status.Success; Container.FinishSimulation(); + + IterationStatistics.FinishSimulation(RunName + CycleName + RunSuffix + RunIdentifier); + Log.Info("VectoJob finished."); } diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs index 8bd0691f5a9a4797b5ecade147920de2f7aa195d..5125e3db06a1b1f7cbc5b0fc7cdd98c6a4c5bebb 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/CombustionEngine.cs @@ -144,6 +144,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl IResponse ITnOutPort.Request(Second absTime, Second dt, NewtonMeter torque, PerSecond angularVelocity, bool dryRun) { + IterationStatistics.Increment(this, "Requests"); + Log.Debug("Engine Powertrain Power Request: torque: {0}, angularVelocity: {1}, power: {2}", torque, angularVelocity, torque * angularVelocity); diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 217433ddcf9ae140f2a8619dab782911a54989f4..252eb519fdeccbe8a62afebd951be38878dcfae2 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -32,6 +32,7 @@ using System; using System.Diagnostics; using System.Linq; +using iTextSharp.text.pdf; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -101,6 +102,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient) { + IterationStatistics.Increment(this, "Requests"); + Log.Debug("==== DRIVER Request (distance) ===="); Log.Debug( "Request: absTime: {0}, ds: {1}, targetVelocity: {2}, gradient: {3} | distance: {4}, velocity: {5}, vehicle stopped: {6}", @@ -119,7 +122,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse Request(Second absTime, Second dt, MeterPerSecond targetVelocity, Radian gradient) { - //VehicleStopped = true; + IterationStatistics.Increment(this, "Requests"); + Log.Debug("==== DRIVER Request (time) ===="); Log.Debug( "Request: absTime: {0}, dt: {1}, targetVelocity: {2}, gradient: {3} | distance: {4}, velocity: {5} gear: {6}: vehicle stopped: {7}", @@ -151,6 +155,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse DrivingActionAccelerate(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient, IResponse previousResponse = null) { + IterationStatistics.Increment(this, "Accelerate"); + Log.Debug("DrivingAction Accelerate"); var operatingPoint = ComputeAcceleration(ds, targetVelocity); @@ -228,6 +234,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// <returns></returns> public IResponse DrivingActionCoast(Second absTime, Meter ds, MeterPerSecond maxVelocity, Radian gradient) { + IterationStatistics.Increment(this, "Coast"); Log.Debug("DrivingAction Coast"); return CoastOrRollAction(absTime, ds, maxVelocity, gradient, false); @@ -243,6 +250,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// <returns></returns> public IResponse DrivingActionRoll(Second absTime, Meter ds, MeterPerSecond maxVelocity, Radian gradient) { + IterationStatistics.Increment(this, "Roll"); + Log.Debug("DrivingAction Roll"); var retVal = CoastOrRollAction(absTime, ds, maxVelocity, gradient, true); @@ -344,6 +353,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse DrivingActionBrake(Second absTime, Meter ds, MeterPerSecond nextTargetSpeed, Radian gradient, IResponse previousResponse = null, Meter targetDistance = null) { + IterationStatistics.Increment(this, "Brake"); + Log.Debug("DrivingAction Brake"); IResponse retVal = null; @@ -357,8 +368,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl var nextAcceleration = DriverData.AccelerationCurve.Lookup(v2).Deceleration; var tmp = ComputeTimeInterval(VectoMath.Min(operatingPoint.Acceleration, nextAcceleration), operatingPoint.SimulationDistance); - if (!operatingPoint.Acceleration.IsEqual(nextAcceleration) && - operatingPoint.SimulationDistance.IsEqual(tmp.SimulationDistance)) { + if (!operatingPoint.Acceleration.IsEqual(nextAcceleration) && operatingPoint.SimulationDistance.IsEqual(tmp.SimulationDistance)) { // only adjust operating point if the acceleration is different but the simulation distance is not modified // i.e., braking to the next sample point (but a little bit slower) Log.Debug("adjusting acceleration from {0} to {1}", operatingPoint.Acceleration, tmp.Acceleration); @@ -495,13 +505,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl private OperatingPoint SearchBrakingPower(Second absTime, Meter ds, Radian gradient, MeterPerSquareSecond acceleration, IResponse initialResponse) { + IterationStatistics.Increment(this, "SearchBrakingPower", 0); + var operatingPoint = new OperatingPoint { SimulationDistance = ds, Acceleration = acceleration }; operatingPoint = ComputeTimeInterval(operatingPoint.Acceleration, ds); Watt deltaPower = null; initialResponse.Switch(). Case<ResponseGearShift>(r => { - var nextResp = NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, - gradient, true); + IterationStatistics.Increment(this, "SearchBrakingPower"); + var nextResp = NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration,gradient, true); deltaPower = nextResp.GearboxPowerRequest; }). Case<ResponseUnderload>(r => @@ -517,15 +529,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl evaluateFunction: x => { DataBus.BrakePower = x; operatingPoint = ComputeTimeInterval(operatingPoint.Acceleration, ds); - return NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, gradient, - true); + + IterationStatistics.Increment(this, "SearchBrakingPower"); + return NextComponent.Request(absTime, operatingPoint.SimulationInterval, operatingPoint.Acceleration, gradient,true); }, criterion: result => { var response = (ResponseDryRun)result; var delta = DataBus.ClutchClosed(absTime) ? response.DeltaDragLoad : response.GearboxPowerRequest; return delta.Value(); }); + return operatingPoint; + } catch (Exception) { Log.Error("Failed to find operating point for braking power! absTime: {0}", absTime); throw; @@ -535,6 +550,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected OperatingPoint SearchOperatingPoint(Second absTime, Meter ds, Radian gradient, MeterPerSquareSecond acceleration, IResponse initialResponse, bool coasting = false) { + IterationStatistics.Increment(this, "SearchOperatingPoint", 0); + var retVal = new OperatingPoint { Acceleration = acceleration, SimulationDistance = ds }; var actionRoll = !DataBus.ClutchClosed(absTime); @@ -552,7 +569,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Default(r => { throw new UnexpectedResponseException("Unknown response type.", r); }); } var delta = origDelta; - try { retVal.Acceleration = SearchAlgorithm.Search(acceleration, delta, Constants.SimulationSettings.OperatingPointInitialSearchIntervalAccelerating, @@ -570,6 +586,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl retVal.SimulationInterval = tmp.SimulationInterval; retVal.SimulationDistance = tmp.SimulationDistance; } + IterationStatistics.Increment(this, "SearchOperatingPoint"); var response = NextComponent.Request(absTime, retVal.SimulationInterval, acc, gradient, true); response.OperatingPoint = retVal; return response; @@ -603,11 +620,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl } if (!retVal.Acceleration.IsBetween(DriverData.AccelerationCurve.MaxDeceleration(), - DriverData.AccelerationCurve.MaxAcceleration())) { - Log.Info("Operating Point outside driver acceleration limits: a: {0}", retVal.Acceleration); - } - - return ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance); + DriverData.AccelerationCurve.MaxAcceleration())) { + Log.Info("Operating Point outside driver acceleration limits: a: {0}", retVal.Acceleration); + } + return ComputeTimeInterval(retVal.Acceleration, retVal.SimulationDistance); } /// <summary> @@ -791,19 +807,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public IResponse Response; } - [DebuggerDisplay("a: {Acceleration}, dt: {SimulationInterval}, ds: {SimulationDistance}")] - public struct OperatingPoint - { - public MeterPerSquareSecond Acceleration; - public Meter SimulationDistance; - public Second SimulationInterval; - - public override string ToString() - { - return string.Format("a: {0}, dt: {1}, ds: {2}", Acceleration, SimulationInterval, SimulationDistance); - } - } - [Flags] protected enum LimitationMode { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs index 4e329695d5c183b8c56ad3d83e76a3a5df47ea06..3419189712d6091f6ad9c8985bafad53e70e26b0 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Gearbox.cs @@ -215,10 +215,13 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl /// </returns> public IResponse Request(Second absTime, Second dt, NewtonMeter torque, PerSecond angularVelocity, bool dryRun) { + IterationStatistics.Increment(this, "Requests"); + Log.Debug("Gearbox Power Request: torque: {0}, angularVelocity: {1}", torque, angularVelocity); if (DataBus.VehicleStopped) { _engageTime = absTime; } + IResponse retVal; // TODO: MQ 2016/03/10: investigate further the effects of having the condition angularvelocity != 0 if (ClutchClosed(absTime) /* && !angularVelocity.IsEqual(0) */) { diff --git a/VectoCore/VectoCore/Utils/DelaunayMap.cs b/VectoCore/VectoCore/Utils/DelaunayMap.cs index 90d87d4cd7ad0eaf0972459f76223b3e2e610c0c..9782d4d6f9c3bca202e2b4f6c204a5a9910adb74 100644 --- a/VectoCore/VectoCore/Utils/DelaunayMap.cs +++ b/VectoCore/VectoCore/Utils/DelaunayMap.cs @@ -159,7 +159,8 @@ namespace TUGraz.VectoCore.Utils /// <summary> /// Draws the delaunay map (except supertriangle). /// </summary> - private void DrawGraph(int i, List<Triangle> triangles, Triangle superTriangle, double xmin, double xmax, double ymin, + [Conditional("TRACE")] + private static void DrawGraph(int i, List<Triangle> triangles, Triangle superTriangle, double xmin, double xmax, double ymin, double ymax, Point lastPoint = null) { using (var chart = new Chart { Width = 1000, Height = 1000 }) { diff --git a/VectoCore/VectoCore/Utils/DictionaryExtensionMethods.cs b/VectoCore/VectoCore/Utils/DictionaryExtensionMethods.cs new file mode 100644 index 0000000000000000000000000000000000000000..2236bd3b8a61a1d43ea6801641a08fcc8dd961f7 --- /dev/null +++ b/VectoCore/VectoCore/Utils/DictionaryExtensionMethods.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; + +namespace TUGraz.VectoCore.Utils +{ + internal static class DictionaryExtensionMethods + { + public static object GetValueOrNull<TKey, TValue>(this IDictionary<TKey, TValue> dictionary,TKey key) + { + TValue value; + return dictionary.TryGetValue(key, out value) ? (object)value : DBNull.Value; + } + } +} diff --git a/VectoCore/VectoCore/Utils/IterationStatistics.cs b/VectoCore/VectoCore/Utils/IterationStatistics.cs new file mode 100644 index 0000000000000000000000000000000000000000..acaf72a224d7ac6b0b9e5f5b2a91f3d49bda5ac1 --- /dev/null +++ b/VectoCore/VectoCore/Utils/IterationStatistics.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using System.Threading; +using TUGraz.VectoCommon.Utils; + +namespace TUGraz.VectoCore.Utils +{ + public static class IterationStatistics + { + private static readonly ThreadLocal<List<DataEntry>> DataLocal = + new ThreadLocal<List<DataEntry>>(() => new List<DataEntry>()); + + public static List<DataEntry> Data + { + get { return DataLocal.Value; } + } + + private static readonly ThreadLocal<Stopwatch> TimerLocal = new ThreadLocal<Stopwatch>(Stopwatch.StartNew); + + private static Stopwatch Timer + { + get { return TimerLocal.Value; } + } + + private static readonly ThreadLocal<Dictionary<string, Dictionary<string, double>>> CurrentLocal = + new ThreadLocal<Dictionary<string, Dictionary<string, double>>>( + () => new Dictionary<string, Dictionary<string, double>>()); + + private static Dictionary<string, Dictionary<string, double>> Current + { + get { return CurrentLocal.Value; } + set { CurrentLocal.Value = value; } + } + + [Conditional("TRACE")] + public static void Increment<T>(T o, string key, double? value = null) + { + var t = typeof(T).Name; + + if (!Current.ContainsKey(t)) + Current[t] = new Dictionary<string, double>(); + + if (Current[t].ContainsKey(key)) + if (value.HasValue) + Current[t][key] += value.Value; + else + Current[t][key]++; + + else { + if (value.HasValue) + Current[t][key] = value.Value; + else + Current[t][key] = 1; + } + } + + public static void StartIteration() + { + Timer.Restart(); + } + + [Conditional("TRACE"), MethodImpl(MethodImplOptions.Synchronized)] + public static void FinishIteration(Second absTime) + { + Timer.Stop(); + Data.Add(new DataEntry(absTime, Timer.Elapsed, Current)); + Current = new Dictionary<string, Dictionary<string, double>>(); + } + + [Conditional("TRACE")] + public static void FinishSimulation(string runName) + { + var table = new DataTable(); + table.Columns.Add("Distance", typeof(double)); + table.Columns.Add("Time", typeof(double)); + table.Columns.Add("StepDuration", typeof(double)); + table.Columns.Add("StepIterationCount", typeof(double)); + table.Columns.Add("NumDriverRequests", typeof(double)); + table.Columns.Add("NumAccelActions", typeof(double)); + table.Columns.Add("NumBrakeActions", typeof(double)); + table.Columns.Add("NumCoastActions", typeof(double)); + table.Columns.Add("NumRollActions", typeof(double)); + table.Columns.Add("SearchOPIterations", typeof(double)); + table.Columns.Add("SearchBrakeIterations", typeof(double)); + table.Columns.Add("NumGearboxRequests", typeof(double)); + table.Columns.Add("NumEngineRequests", typeof(double)); + + foreach (var entry in Data) { + var row = table.NewRow(); + row["StepDuration"] = entry.Duration.TotalMilliseconds; + + if (entry.Values.ContainsKey("DistanceRun")) { + row["Distance"] = entry.Values["DistanceRun"].GetValueOrNull("Distance"); + row["Time"] = entry.Values["DistanceRun"].GetValueOrNull("Time"); + row["StepIterationCount"] = entry.Values["DistanceRun"].GetValueOrNull("Iterations"); + } + if (entry.Values.ContainsKey("Driver")) { + row["NumDriverRequests"] = entry.Values["Driver"].GetValueOrNull("Requests"); + row["NumAccelActions"] = entry.Values["Driver"].GetValueOrNull("Accelerate"); + row["NumBrakeActions"] = entry.Values["Driver"].GetValueOrNull("Brake"); + row["NumCoastActions"] = entry.Values["Driver"].GetValueOrNull("Coast"); + row["NumRollActions"] = entry.Values["Driver"].GetValueOrNull("Roll"); + row["SearchOPIterations"] = entry.Values["Driver"].GetValueOrNull("SearchOperatingPoint"); + row["SearchBrakeIterations"] = entry.Values["Driver"].GetValueOrNull("SearchBrakingPower"); + } + if (entry.Values.ContainsKey("Gearbox")) { + row["NumGearboxRequests"] = entry.Values["Gearbox"].GetValueOrNull("Requests"); + } + if (entry.Values.ContainsKey("CombustionEngine")) { + row["NumEngineRequests"] = entry.Values["CombustionEngine"].GetValueOrNull("Requests"); + } + table.Rows.Add(row); + } + var writer = new StreamWriter("statistics_" + runName + ".csv"); + VectoCSVFile.Write(writer, table); + } + + public sealed class DataEntry + { + public readonly TimeSpan Duration; + public readonly Second Time; + public readonly Dictionary<string, Dictionary<string, double>> Values; + + public DataEntry(Second time, TimeSpan duration, Dictionary<string, Dictionary<string, double>> values) + { + Time = time; + Duration = duration; + Values = values; + } + } + } +} \ No newline at end of file diff --git a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs index 6dea3fd18627af959a3e0ca6e49cc8a259680110..9cff57e03547eae0111b2c84af6d7a6e208e9a9b 100644 --- a/VectoCore/VectoCore/Utils/SearchAlgorithm.cs +++ b/VectoCore/VectoCore/Utils/SearchAlgorithm.cs @@ -31,7 +31,10 @@ using System; using System.Data; +using System.Diagnostics; +using System.IO; using System.Linq; +using System.Threading; using TUGraz.VectoCore.Configuration; using TUGraz.VectoCommon.Exceptions; using TUGraz.VectoCommon.Models; @@ -85,15 +88,15 @@ namespace TUGraz.VectoCore.Utils /// abortCriterion: result => true/false /// </code> /// </summary> - public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, - Func<T, object> evaluateFunction, Func<object, double> criterion, Func<object, int, bool> abortCriterion, - ref int iterationCount) where T : SIBase<T> + public static T Search<T>(T x, SI y, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction, + Func<object, double> criterion, Func<object, int, bool> abortCriterion, ref int iterationCount) where T : SIBase<T> { T result; try { - result = InterpolateLinear(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, + result = InterpolateSearch(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, ref iterationCount); - } catch (VectoException ex) { + } + catch (VectoException ex) { var log = LogManager.GetLogger(typeof(SearchAlgorithm).FullName); log.Debug("Falling back to LineSearch. InterpolationSearch failed: " + ex.Message); result = LineSearch(x, y, interval, getYValue, evaluateFunction, criterion, abortCriterion, ref iterationCount); @@ -116,7 +119,7 @@ namespace TUGraz.VectoCore.Utils var origY = y; var debug = new DebugData(); debug.Add(new { x, y }); - log.Debug("Log Disabled during Search LineSearch."); + log.Debug("Log Disabled during LineSearch."); LogManager.DisableLogging(); try { for (var count = 1; count < 100; count++, iterationCount++) { @@ -126,7 +129,6 @@ namespace TUGraz.VectoCore.Utils interval *= intervalFactor; x += interval * -y.Sign(); - var result = evaluateFunction(x); y = getYValue(result); debug.Add(new { x, y, delta = criterion(result), result }); @@ -135,6 +137,7 @@ namespace TUGraz.VectoCore.Utils log.Debug("LineSearch found an operating point after {0} function calls.", count); //iterationCount += count; LogManager.DisableLogging(); + AppendDebug(debug); return x; } if (abortCriterion != null && abortCriterion(result, iterationCount)) { @@ -153,29 +156,52 @@ namespace TUGraz.VectoCore.Utils log.Error("Exceeded max iterations when searching for operating point!"); log.Error("debug: {0}", debug); - //WriteSerach(debug, "LineSearch.csv"); + WriteSearch(debug, "LineSearch.csv"); throw new VectoSearchFailedException("Failed to find operating point! points: {0}", debug); } + [Conditional("TRACE")] + private static void AppendDebug(DebugData debug) + { + var xmin = debug.Data.Min(d => d.x).Value(); + var xmax = debug.Data.Max(d => d.x).Value(); + var ymin = debug.Data.Min(d => d.y).Value(); + var ymax = debug.Data.Max(d => d.y).Value(); + + var rand = new Random().Next(); + using (var f = new StreamWriter(File.Open("LineSearch-" + Thread.CurrentThread.ManagedThreadId + "-statistics.csv", FileMode.Append))) { + foreach (var d in debug.Data) { + f.WriteLine(string.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}", + rand, + (d.x.Value()-xmin)/(xmax-xmin), + (d.y.Value()-ymin)/(ymax-ymin), + d.x.Value()/Math.Max(Math.Abs(xmax),Math.Abs(xmin)), + d.y.Value()/Math.Max(Math.Abs(ymax),Math.Abs(ymin)), + d.x, d.y)); + } + } + } + /// <summary> /// Interpolating Search algorithm. /// Calculates linear equation of 2 points and jumps directly to root-point. /// </summary> - private static T InterpolateLinear<T>(T x1, SI y1, T interval, Func<object, SI> getYValue, + private static T InterpolateSearch<T>(T x1, SI y1, T interval, Func<object, SI> getYValue, Func<T, object> evaluateFunction, Func<object, double> criterion, Func<object, int, bool> abortCriterion, ref int iterationCount) where T : SIBase<T> { var log = LogManager.GetLogger(typeof(SearchAlgorithm).FullName); var debug = new DebugData(); debug.Add(new { x = x1, y = y1 }); - log.Debug("Log Disabled during Search InterpolateLinear."); + log.Debug("Log Disabled during InterpolateSearch."); LogManager.DisableLogging(); try { var x2 = x1 + interval; var result = evaluateFunction(x2); if (criterion(result).IsEqual(0, Constants.SimulationSettings.InterpolateSearchTolerance)) { LogManager.EnableLogging(); - log.Debug("InterpolateLinear found an operating point after 1 function call."); + log.Debug("InterpolateSearch found an operating point after 1 function call."); + AppendDebug(debug); LogManager.DisableLogging(); iterationCount++; return x2; @@ -196,8 +222,9 @@ namespace TUGraz.VectoCore.Utils } debug.Add(new { x = x2, y = getYValue(result), delta = criterion(result), result }); LogManager.EnableLogging(); - log.Debug("InterpolateLinear could not get more exact. Aborting after {0} function calls.", count); + log.Debug("InterpolateSearch could not get more exact. Aborting after {0} function calls.", count); LogManager.DisableLogging(); + AppendDebug(debug); //iterationCount += count; return x2; } @@ -206,9 +233,9 @@ namespace TUGraz.VectoCore.Utils if (criterion(result).IsEqual(0, Constants.SimulationSettings.InterpolateSearchTolerance)) { debug.Add(new { x = x2, y = getYValue(result), delta = criterion(result), result }); LogManager.EnableLogging(); - log.Debug("InterpolateLinear found an operating point after {0} function calls.", count); + log.Debug("InterpolateSearch found an operating point after {0} function calls.", count); LogManager.DisableLogging(); - //iterationCount += count; + AppendDebug(debug); return x2; } if (abortCriterion != null && abortCriterion(result, iterationCount)) { @@ -223,16 +250,16 @@ namespace TUGraz.VectoCore.Utils LogManager.EnableLogging(); } - //iterationCount += 30; - log.Debug("InterpolateLinear could not find an operating point."); + log.Debug("InterpolateSearch could not find an operating point."); log.Error("Exceeded max iterations when searching for operating point!"); log.Error("debug: {0}", debug); - //WriteSerach(debug, "InterpolateSearch.csv"); + WriteSearch(debug, "InterpolateSearch.csv"); throw new VectoSearchFailedException("Failed to find operating point! points: {0}", debug); } - private static void WriteSerach(DebugData debug, string filename) + [Conditional("TRACE")] + private static void WriteSearch(DebugData debug, string filename) { var table = new DataTable(); table.Columns.Add("x", typeof(double)); diff --git a/VectoCore/VectoCore/VectoCore.csproj b/VectoCore/VectoCore/VectoCore.csproj index 97c59843a00806f72e6fb4ff7bbeb8c121849885..645bd17134fda1be7be7c8c3e5b1b02410d7ae60 100644 --- a/VectoCore/VectoCore/VectoCore.csproj +++ b/VectoCore/VectoCore/VectoCore.csproj @@ -19,7 +19,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> + <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> @@ -74,7 +74,8 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> @@ -202,6 +203,8 @@ </Compile> <Compile Include="Utils\DataTableExtensionMethods.cs" /> <Compile Include="Utils\DateTimeFallbackDeserializer.cs" /> + <Compile Include="Utils\DictionaryExtensionMethods.cs" /> + <Compile Include="Utils\IterationStatistics.cs" /> <Compile Include="Utils\RessourceHelper.cs" /> <Compile Include="Models\Declaration\Segment.cs" /> <Compile Include="Models\Declaration\Axle.cs" /> diff --git a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs index d8332f4f274151e2f88bebb67b06fb8f34099c49..fb06010ea6f965359fd83de913da9bf948f71d42 100644 --- a/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs +++ b/VectoCore/VectoCoreTest/Integration/BusAuxiliaries/SimpleCycleTest.cs @@ -42,11 +42,15 @@ namespace TUGraz.VectoCore.Tests.Integration.BusAuxiliaries public class SimpleCycleTest { [TestInitialize] - public void DisableLogging() + public void Init() { LogManager.DisableLogging(); - //GraphWriter.Disable(); - +#if TRACE + GraphWriter.Enable(); +#else + GraphWriter.Disable(); +#endif + GraphWriter.Xfields = new[] { ModalResultField.time, ModalResultField.dist }; GraphWriter.Yfields = new[] { diff --git a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs index 8663585352108aaf16e511f9088099a3ea1b6796..800fc752c43c9bcdbae15c5951f1d80c3b442f5d 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachAdvancedAuxPowertrain.cs @@ -42,7 +42,7 @@ namespace TUGraz.VectoCore.Tests.Integration { var fileWriter = new FileOutputWriter(modFileName); var modData = new ModalDataContainer(modFileName, fileWriter) { WriteAdvancedAux = true }; - var container = new VehicleContainer(ExecutionMode.Engineering, modData); + var container = new VehicleContainer(ExecutionMode.Engineering, modData) { RunData = new VectoRunData { JobName = modFileName, Cycle = cycleData } }; var engineData = MockSimulationDataFactory.CreateEngineDataFromFile(EngineFile); var axleGearData = CreateAxleGearData(); diff --git a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs index 497d00ffe374b0c31f6e3bf08743be98e52e0e2d..d4ec21b854905407772425a285500f5063a5d09b 100644 --- a/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/CoachPowerTrain.cs @@ -31,6 +31,7 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -61,7 +62,7 @@ namespace TUGraz.VectoCore.Tests.Integration public static VectoRun CreateEngineeringRun(DrivingCycleData cycleData, string modFileName, bool overspeed = false) { - var container = CreatePowerTrain(cycleData, modFileName.Replace(".vmod", ""), overspeed); + var container = CreatePowerTrain(cycleData, Path.GetFileNameWithoutExtension(modFileName), overspeed); return new DistanceRun(container); } @@ -70,7 +71,7 @@ namespace TUGraz.VectoCore.Tests.Integration { var fileWriter = new FileOutputWriter(modFileName); var modData = new ModalDataContainer(modFileName, fileWriter); - var container = new VehicleContainer(ExecutionMode.Engineering, modData, null); + var container = new VehicleContainer(ExecutionMode.Engineering, modData, null) { RunData = new VectoRunData{JobName = modFileName, Cycle = cycleData }}; var engineData = MockSimulationDataFactory.CreateEngineDataFromFile(EngineFile); var axleGearData = CreateAxleGearData(); diff --git a/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestCoach.cs b/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestCoach.cs index f8ce8b78e8fbb7908ca0f963d54173dabf759a55..7febf10c61dad617b2d0131b15b1e51d9d3626e5 100644 --- a/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestCoach.cs +++ b/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestCoach.cs @@ -39,11 +39,14 @@ namespace TUGraz.VectoCore.Tests.Integration.DriverStrategy public class DriverStrategyTestCoach { [TestInitialize] - public void DisableLogging() + public void Init() { //LogManager.DisableLogging(); - //GraphWriter.Disable(); - +#if TRACE + GraphWriter.Enable(); +#else + GraphWriter.Disable(); +#endif GraphWriter.Xfields = new[] { ModalResultField.time, ModalResultField.dist }; GraphWriter.Yfields = new[] { diff --git a/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestTruck.cs b/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestTruck.cs index 62737dacf9f879a2ec5566baeb1fa8216c4f7c12..b5b63346413c99416e2a50948ae4a81cf816914f 100644 --- a/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestTruck.cs +++ b/VectoCore/VectoCoreTest/Integration/DriverStrategy/DriverStrategyTestTruck.cs @@ -43,7 +43,11 @@ namespace TUGraz.VectoCore.Tests.Integration.DriverStrategy public void DisableLogging() { //LogManager.DisableLogging(); - //GraphWriter.Disable(); +#if TRACE + GraphWriter.Enable(); +#else + GraphWriter.Disable(); +#endif GraphWriter.Xfields = new[] { ModalResultField.time, ModalResultField.dist }; diff --git a/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs b/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs index b10ef31bdadb138fbf099356a658c2c76792a3f0..2d8b84e287f64ee038010d6c9354c1f76b3ab85a 100644 --- a/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs +++ b/VectoCore/VectoCoreTest/Integration/Truck40tPowerTrain.cs @@ -83,7 +83,7 @@ namespace TUGraz.VectoCore.Tests.Integration { var fileWriter = new FileOutputWriter(modFileName); var modData = new ModalDataContainer(modFileName, fileWriter); - var container = new VehicleContainer(executionMode: ExecutionMode.Engineering, modData: modData); + var container = new VehicleContainer(executionMode: ExecutionMode.Engineering, modData: modData) { RunData = new VectoRunData{ JobName = modFileName, Cycle = cycleData}}; var engineData = MockSimulationDataFactory.CreateEngineDataFromFile(EngineFile); var axleGearData = CreateAxleGearData(); diff --git a/VectoCore/VectoCoreTest/Utils/GraphWriter.cs b/VectoCore/VectoCoreTest/Utils/GraphWriter.cs index 91f0e7fd7dab5182341873182cd8e091e1d5d8e2..a17332c7d8f6796a6edbb00031df11227f58799c 100644 --- a/VectoCore/VectoCoreTest/Utils/GraphWriter.cs +++ b/VectoCore/VectoCoreTest/Utils/GraphWriter.cs @@ -62,7 +62,7 @@ namespace TUGraz.VectoCore.Tests.Utils public static ModalResultField[] Xfields { get; set; } - public static void Enabled() + public static void Enable() { _enabled = true; } diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 3147d04a8853c60dbb4abf157f8b6f0dc336ce1d..e82aba9749d65345bc5b1b1b59317a29b58b5dda 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -22,7 +22,7 @@ <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> + <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> @@ -30,7 +30,8 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup>