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

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

Merge pull request #549 in VECTO/vecto-sim from master to develop

* commit 'ae529629':
  adding whtc correction in VTP Mode
parents f8fbd929 ae529629
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -30,5 +30,5 @@ ...@@ -30,5 +30,5 @@
*/ */
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.1.1.1054")] [assembly: AssemblyVersion("3.2.1.1054")]
[assembly: AssemblyFileVersion("3.1.1.1054")] [assembly: AssemblyFileVersion("3.2.1.1054")]
\ No newline at end of file
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
<#@ template language="C#" #> <#@ template language="C#" #>
<#@ output extension=".cs"#> <#@ output extension=".cs"#>
<#@ include file="../../VectoCore/VectoCore/VersionNumber.t4" once="true" #>
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.1.1.<#= this.RevisionNumber #>")] [assembly: AssemblyVersion("<#= GetVectoCoreVersionNumber() #>")]
[assembly: AssemblyFileVersion("3.1.1.<#= this.RevisionNumber #>")] [assembly: AssemblyFileVersion("<#= GetVectoCoreVersionNumber() #>")]
<#+ \ No newline at end of file
int RevisionNumber = (int)(DateTime.UtcNow - new DateTime(2015, 1, 1)).TotalDays;
#>
\ No newline at end of file
...@@ -156,6 +156,9 @@ namespace TUGraz.VectoCore.Configuration ...@@ -156,6 +156,9 @@ namespace TUGraz.VectoCore.Configuration
public static readonly Kilogram MaximumGrossVehicleWeight = 40000.SI<Kilogram>(); public static readonly Kilogram MaximumGrossVehicleWeight = 40000.SI<Kilogram>();
public static readonly Kilogram MaximumGrossVehicleWeightEMS = 60000.SI<Kilogram>(); public static readonly Kilogram MaximumGrossVehicleWeightEMS = 60000.SI<Kilogram>();
public static readonly MeterPerSecond HighwaySpeedThreshold = 70.KMPHtoMeterPerSecond();
public static readonly MeterPerSecond RuralSpeedThreshold = 50.KMPHtoMeterPerSecond();
} }
public static class XML public static class XML
......
...@@ -337,10 +337,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ...@@ -337,10 +337,10 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl
var motorway = auxData.First(x => x.ID == auxId && x.MissionType == MissionType.LongHaul); var motorway = auxData.First(x => x.ID == auxId && x.MissionType == MissionType.LongHaul);
aux.AddCycle(auxId, entry => { aux.AddCycle(auxId, entry => {
if (entry.VehicleTargetSpeed >= 70.KMPHtoMeterPerSecond()) { if (entry.VehicleTargetSpeed >= Constants.SimulationSettings.HighwaySpeedThreshold) {
return motorway.PowerDemand; return motorway.PowerDemand;
} }
if (entry.VehicleTargetSpeed >= 50.KMPHtoMeterPerSecond()) { if (entry.VehicleTargetSpeed >= Constants.SimulationSettings.RuralSpeedThreshold) {
return rural.PowerDemand; return rural.PowerDemand;
} }
return urban.PowerDemand; return urban.PowerDemand;
......
...@@ -391,7 +391,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -391,7 +391,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var fc = result.Value; var fc = result.Value;
var fcAux = fc; var fcAux = fc;
var fcWHTC = fcAux * ModelData.FuelConsumptionCorrectionFactor; var fcWHTC = fcAux * WHTCCorrectionFactor;
var fcAAUX = fcWHTC; var fcAAUX = fcWHTC;
var advancedAux = EngineAux as BusAuxiliariesAdapter; var advancedAux = EngineAux as BusAuxiliariesAdapter;
if (advancedAux != null) { if (advancedAux != null) {
...@@ -407,6 +407,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -407,6 +407,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
container[ModalResultField.FCFinal] = fcFinal; container[ModalResultField.FCFinal] = fcFinal;
} }
protected virtual double WHTCCorrectionFactor
{
get { return ModelData.FuelConsumptionCorrectionFactor; }
}
protected override void DoCommitSimulationStep() protected override void DoCommitSimulationStep()
{ {
AdvanceState(); AdvanceState();
......
...@@ -157,5 +157,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -157,5 +157,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
{ {
return DataBus.CycleData.LeftSample.EngineSpeed; return DataBus.CycleData.LeftSample.EngineSpeed;
} }
}
protected override double WHTCCorrectionFactor
{
get {
if (DataBus.CycleData.LeftSample.VehicleTargetSpeed >= Constants.SimulationSettings.HighwaySpeedThreshold) {
return ModelData.WHTCMotorway;
}
if (DataBus.CycleData.LeftSample.VehicleTargetSpeed >= Constants.SimulationSettings.RuralSpeedThreshold) {
return ModelData.WHTCRural;
}
return ModelData.WHTCUrban;
}
}
}
} }
\ No newline at end of file
...@@ -183,5 +183,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -183,5 +183,11 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
// 0.3.KMPHtoMeterPerSecond()); // 0.3.KMPHtoMeterPerSecond());
} }
} }
protected override void DoWriteModalResults(IModalDataContainer container)
{
base.DoWriteModalResults(container);
container[ModalResultField.v_act] = CycleIterator.LeftSample.VehicleTargetSpeed;
}
} }
} }
\ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/ */
using System.IO;
using NUnit.Framework; using NUnit.Framework;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
using TUGraz.VectoCore.InputData.FileIO.JSON; using TUGraz.VectoCore.InputData.FileIO.JSON;
...@@ -41,10 +42,16 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP ...@@ -41,10 +42,16 @@ namespace TUGraz.VectoCore.Tests.Integration.VTP
[TestFixture] [TestFixture]
public class VTPTest public class VTPTest
{ {
[TestCase()] [OneTimeSetUp]
public void Init()
{
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
}
[TestCase()]
public void RunVTP() public void RunVTP()
{ {
var jobFile = @"TestData\Integration\VTPMode\GenericVehicle\class_5_generic_vehicle.vecto"; var jobFile = @"TestData\Integration\VTPMode\GenericVehicle\class_5_generic vehicle.vecto";
var fileWriter = new FileOutputWriter(jobFile); var fileWriter = new FileOutputWriter(jobFile);
var sumWriter = new SummaryDataContainer(fileWriter); var sumWriter = new SummaryDataContainer(fileWriter);
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<Compile Include="Integration\CoachAdvancedAuxPowertrain.cs" /> <Compile Include="Integration\CoachAdvancedAuxPowertrain.cs" />
<Compile Include="Integration\CoachPowerTrain.cs" /> <Compile Include="Integration\CoachPowerTrain.cs" />
<Compile Include="Integration\DriverStrategy\SimpleCycles.cs" /> <Compile Include="Integration\DriverStrategy\SimpleCycles.cs" />
<Compile Include="Integration\EPTP\EPTPTest.cs" /> <Compile Include="Integration\VTP\VTPTest.cs" />
<Compile Include="Integration\FuelTypesTest.cs" /> <Compile Include="Integration\FuelTypesTest.cs" />
<Compile Include="Integration\FullCycleDeclarationTest.cs"> <Compile Include="Integration\FullCycleDeclarationTest.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
......
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