Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

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

convert speed limit to m/s for computing time shares

parent 25e203b8
No related branches found
No related tags found
No related merge requests found
...@@ -178,7 +178,8 @@ namespace TUGraz.VectoCore.OutputData ...@@ -178,7 +178,8 @@ namespace TUGraz.VectoCore.OutputData
a = x.Field<MeterPerSquareSecond>((int)ModalResultField.acc), a = x.Field<MeterPerSquareSecond>((int)ModalResultField.acc),
dt = x.Field<Second>((int)ModalResultField.simulationInterval) dt = x.Field<Second>((int)ModalResultField.simulationInterval)
}) })
.Sum(x => x.v >= 0.1 && x.a.IsBetween(-0.125, 0.125) ? x.dt : 0.SI<Second>()).DefaultIfNull(0); .Sum(x => x.v >= 0.1.KMPHtoMeterPerSecond() && x.a.IsBetween(-0.125, 0.125) ? x.dt : 0.SI<Second>())
.DefaultIfNull(0);
return 100 * (cruiseTime / data.Duration()).Cast<Scalar>(); return 100 * (cruiseTime / data.Duration()).Cast<Scalar>();
} }
...@@ -189,7 +190,7 @@ namespace TUGraz.VectoCore.OutputData ...@@ -189,7 +190,7 @@ namespace TUGraz.VectoCore.OutputData
v = x.Field<MeterPerSecond>((int)ModalResultField.v_act), v = x.Field<MeterPerSecond>((int)ModalResultField.v_act),
dt = x.Field<Second>((int)ModalResultField.simulationInterval) dt = x.Field<Second>((int)ModalResultField.simulationInterval)
}) })
.Sum(x => x.v < 0.1 ? x.dt : 0.SI<Second>()) ?? 0.SI<Second>(); .Sum(x => x.v < 0.1.KMPHtoMeterPerSecond() ? x.dt : 0.SI<Second>()) ?? 0.SI<Second>();
return 100 * (stopTime / data.Duration()).Cast<Scalar>(); return 100 * (stopTime / data.Duration()).Cast<Scalar>();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment