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

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

Merge pull request #548 in VECTO/vecto-sim from ~EMQUARIMA/vecto-sim:master to master

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