Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

single bus: filter run data for double decker: simulate only the matching configurations

parent be8fa5ff
No related branches found
No related tags found
No related merge requests found
......@@ -123,8 +123,10 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl {
powertrainConfig = CreateVectoRunData(vehicle, 0, null, new KeyValuePair<LoadingType, Kilogram>());
fuels = new List<List<FuelData.Entry>>();
} else {
powertrainConfig = CreateVectoRunData(
vehicle, 0, _segment.Missions.First(), _segment.Missions.First().Loadings.First());
powertrainConfig = _segment.Missions.Select(
mission => CreateVectoRunData(
vehicle, 0, mission, mission.Loadings.First()))
.FirstOrDefault(x => x != null);
fuels = vehicle.Components.EngineInputData.EngineModes.Select(x => x.Fuels.Select(f => DeclarationData.FuelData.Lookup(f.FuelType, vehicle.TankSystem)).ToList())
.ToList();
}
......
......@@ -66,6 +66,9 @@ namespace TUGraz.VectoCore.InputData.Reader.Impl
foreach (var mission in _segment.Missions) {
foreach (var loading in mission.Loadings) {
var simulationRunData = CreateVectoRunData(vehicle, modeIdx, mission, loading);
if (simulationRunData == null) {
continue;
}
yield return simulationRunData;
}
}
......
......@@ -30,6 +30,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl {
protected override VectoRunData CreateVectoRunData(IVehicleDeclarationInputData vehicle, int modeIdx, Mission mission, KeyValuePair<LoadingType, Kilogram> loading)
{
var doubleDecker = _singleBusInputData.CompletedVehicle.NuberOfPassengersUpperDeck > 0;
if (mission.BusParameter.DoubleDecker != doubleDecker) {
return null;
}
var engine = vehicle.Components.EngineInputData;
var engineModes = engine.EngineModes;
var engineMode = engineModes[modeIdx];
......
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