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

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

no message

parent 9dc2f9ac
No related branches found
No related tags found
No related merge requests found
......@@ -8,13 +8,26 @@ namespace TUGraz.VectoCore.Tests.Integration
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class SimpleDrivingCycles
{
public static DrivingCycleData CreateCycleData(string[] entries)
{
var cycleData = new MemoryStream();
var writer = new StreamWriter(cycleData);
writer.WriteLine("<s>,<v>,<grad>,<stop>");
foreach (var entry in entries) {
writer.WriteLine(entry);
}
writer.Flush();
cycleData.Seek(0, SeekOrigin.Begin);
return DrivingCycleDataReader.ReadFromStream(cycleData, CycleType.DistanceBased);
}
#region Accelerate
public static readonly string[] CycleAccelerate_20_60_Level = {
// <s>,<v>,<grad>,<stop>
" 0, 20, 0, 0",
" 100, 60, 0, 0",
"1000, 60, 0, 0",
"1000, 60, 0, 0"
};
......@@ -22,167 +35,168 @@ namespace TUGraz.VectoCore.Tests.Integration
// <s>,<v>,<grad>,<stop>
" 0, 20, 5, 0",
" 100, 60, 5, 0",
"1000, 60, 5, 0",
"1000, 60, 5, 0"
};
public static readonly string[] CycleAccelerate_20_60_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 20, -5, 0",
" 100, 60, -5, 0",
"1000, 60, -5, 0",
"1000, 60, -5, 0"
};
public static readonly string[] CycleAccelerate_20_60_uphill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 20, 25, 0",
" 100, 60, 25, 0",
"1000, 60, 25, 0",
"1000, 60, 25, 0"
};
public static readonly string[] CycleAccelerate_20_60_downhill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 20, -25, 0",
" 100, 60, -25, 0",
"1000, 60, -25, 0",
"1000, 60, -25, 0"
};
public static readonly string[] CycleAccelerate_20_60_uphill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 20, 15, 0",
" 100, 60, 15, 0",
"1000, 60, 15, 0",
"1000, 60, 15, 0"
};
public static readonly string[] CycleAccelerate_20_60_downhill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 20, -15, 0",
" 100, 60, -15, 0",
"1000, 60, -15, 0",
"1000, 60, -15, 0"
};
public static readonly string[] CycleAccelerate_0_85_level = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
"1000, 85, 0, 0",
"1000, 85, 0, 0"
};
public static readonly string[] CycleAccelerate_0_85_uphill_1 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 1, 2",
"1000, 85, 1, 0",
"1000, 85, 1, 0"
};
public static readonly string[] CycleAccelerate_0_85_uphill_2 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 2, 2",
"1000, 85, 2, 0",
"1000, 85, 2, 0"
};
public static readonly string[] CycleAccelerate_0_85_uphill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 5, 2",
"1000, 85, 5, 0",
"1000, 85, 5, 0"
};
public static readonly string[] CycleAccelerate_0_85_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 85, -5, 0",
"1000, 85, -5, 0",
"1000, 85, -5, 0"
};
public static readonly string[] CycleAccelerate_0_85_downhill_3 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 85, -3, 0",
"1000, 85, -3, 0",
"1000, 85, -3, 0"
};
public static readonly string[] CycleAccelerate_0_85_downhill_1 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 85, -1, 0",
"1000, 85, -1, 0",
"1000, 85, -1, 0"
};
public static readonly string[] CycleAccelerate_0_60_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 60, -5, 0",
"1000, 60, -5, 0",
"1000, 60, -5, 0"
};
public static readonly string[] CycleAccelerate_0_60_downhill_3 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 60, -3, 0",
"1000, 60, -3, 0",
"1000, 60, -3, 0"
};
public static readonly string[] CycleAccelerate_0_60_downhill_1 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 60, -1, 0",
"1000, 60, -1, 0",
"1000, 60, -1, 0"
};
public static readonly string[] CycleAccelerate_0_40_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 40, -5, 0",
"1000, 40, -5, 0",
"1000, 40, -5, 0"
};
public static readonly string[] CycleAccelerate_0_40_downhill_3 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 40, -3, 0",
"1000, 40, -3, 0",
"1000, 40, -3, 0"
};
public static readonly string[] CycleAccelerate_0_40_downhill_1 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 40, -1, 0",
"1000, 40, -1, 0",
"1000, 40, -1, 0"
};
public static readonly string[] CycleAccelerate_0_85_uphill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
" 0, 85, 25, 0",
"1000, 85, 25, 0",
"1000, 85, 25, 0"
};
public static readonly string[] CycleAccelerate_0_85_downhill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, -25, 2",
"1000, 85, -25, 0",
"1000, 85, -25, 0"
};
public static readonly string[] CycleAccelerate_0_85_uphill_10 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 10, 2",
"1000, 85, 10, 0",
"1000, 85, 10, 0"
};
public static readonly string[] CycleAccelerate_0_85_downhill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 0, -15, 2",
"1000, 85, -15, 0",
"1000, 85, -15, 0"
};
public static readonly string[] CycleAccelerate_stop_0_85_level = {
// <s>,<v>,<grad>,<stop>
" 0, 0, 0, 2",
"1000, 85, 0, 0",
"1000, 85, 0, 0"
};
public static readonly string[] CycleAccelerate_20_22_uphill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 20, 5, 0",
" 100, 22, 5, 0",
" 200, 22, 5, 0",
" 200, 22, 5, 0"
};
#endregion
......@@ -193,32 +207,32 @@ namespace TUGraz.VectoCore.Tests.Integration
// <s>,<v>,<grad>,<stop>
" 0, 22, -5, 0",
" 100, 20, -5, 0",
" 300, 20, -5, 0",
" 300, 20, -5, 0"
};
public static readonly string[] CycleDecelerate_60_20_level = {
// <s>,<v>,<grad>,<stop>
" 0, 60, 0, 0",
"1000, 20, 0, 0",
"1100, 20, 0, 0",
"1100, 20, 0, 0"
};
public static readonly string[] CycleDecelerate_45_0_level = {
// <s>,<v>,<grad>,<stop>
" 0, 45, 0, 0",
" 200, 0, 0, 2",
" 200, 0, 0, 2"
};
public static readonly string[] CycleDecelerate_45_0_uphill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 45, 5, 0",
" 200, 0, 5, 2",
" 200, 0, 5, 2"
};
public static readonly string[] CycleDecelerate_45_0_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 45, -5, 0",
" 200, 0, -5, 2",
" 200, 0, -5, 2"
};
public static readonly string[] CycleDecelerate_60_20_uphill_5 = {
......@@ -232,20 +246,20 @@ namespace TUGraz.VectoCore.Tests.Integration
// <s>,<v>,<grad>,<stop>
" 0, 60, -5, 0",
"1000, 20, -5, 0",
"1100, 20, -5, 0",
"1100, 20, -5, 0"
};
public static readonly string[] CycleDecelerate_60_20_uphill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 60, 25, 0",
"1000, 20, 25, 0",
"1000, 20, 25, 0"
};
public static readonly string[] CycleDecelerate_60_20_downhill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 60, -25, 0",
"1000, 20, -25, 0",
"1100, 20, -25, 0",
"1100, 20, -25, 0"
};
public static readonly string[] CycleDecelerate_60_20_uphill_15 = {
......@@ -259,58 +273,58 @@ namespace TUGraz.VectoCore.Tests.Integration
// <s>,<v>,<grad>,<stop>
" 0, 60, -15, 0",
" 800, 20, -15, 0",
"1000, 20, -15, 0",
"1000, 20, -15, 0"
};
public static readonly string[] CycleDecelerate_80_0_level = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 0, 0",
"1000, 0, 0, 2",
"1000, 0, 0, 2"
// "1000, 0, 5, 2",
};
public static readonly string[] CycleDecelerate_80_0_uphill_3 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 3, 0",
"1000, 0, 3, 2",
"1000, 0, 3, 2"
// "1000, 0, 5, 2",
};
public static readonly string[] CycleDecelerate_80_0_uphill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 5, 0",
"1000, 0, 5, 2",
"1000, 0, 5, 2"
// "1000, 0, 5, 2",
};
public static readonly string[] CycleDecelerate_80_0_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, -5, 0",
" 500, 0, -5, 2",
" 500, 0, -5, 2"
};
public static readonly string[] CycleDecelerate_80_0_uphill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 25, 0",
"1000, 0, 25, 2",
"1000, 0, 25, 2"
};
public static readonly string[] CycleDecelerate_80_0_downhill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, -25, 0",
"1000, 0, -25, 2",
"1000, 0, -25, 2"
};
public static readonly string[] CycleDecelerate_80_0_uphill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 15, 0",
"1000, 0, 15, 0",
"1000, 0, 15, 0"
};
public static readonly string[] CycleDecelerate_80_0_downhill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, -15, 0",
"1000, 0, -15, 2",
"1000, 0, -15, 2"
};
#endregion
......@@ -320,98 +334,98 @@ namespace TUGraz.VectoCore.Tests.Integration
public static readonly string[] CycleDrive_80_level = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 0, 0",
"1000, 80, 0, 0",
"1000, 80, 0, 0"
};
public static readonly string[] CycleDrive_80_uphill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 5, 0",
"1000, 80, 5, 0",
"1000, 80, 5, 0"
};
public static readonly string[] CycleDrive_80_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, -5, 0",
" 1000, 80, -5, 0",
" 1000, 80, -5, 0"
};
public static readonly string[] CycleDrive_20_downhill_15 = {
// <s>, <v>, <grad>, <stop>
" 0, 20, -15, 0",
" 500, 20, -25, 0",
" 500, 20, -25, 0"
};
public static readonly string[] CycleDrive_30_downhill_15 = {
// <s>, <v>, <grad>, <stop>
" 0, 30, -15, 0",
" 500, 30, -15, 0",
" 500, 30, -15, 0"
};
public static readonly string[] CycleDrive_50_downhill_15 = {
// <s>, <v>, <grad>, <stop>
" 0, 50, -15, 0",
" 500, 50, -15, 0",
" 500, 50, -15, 0"
};
public static readonly string[] CycleDrive_80_uphill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 25, 0",
" 500, 80, 25, 0",
" 500, 80, 25, 0"
};
public static readonly string[] CycleDrive_80_downhill_15 = {
// <s>, <v>, <grad>, <stop>
" 0, 80, -15, 0",
" 500, 80, -15, 0",
" 500, 80, -15, 0"
};
public static readonly string[] CycleDrive_80_uphill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 15, 0",
" 500, 80, 15, 0",
" 500, 80, 15, 0"
};
public static readonly string[] CycleDrive_10_level = {
// <s>,<v>,<grad>,<stop>
" 0, 10, 0, 0",
"200, 10, 0, 0",
"200, 10, 0, 0"
};
public static readonly string[] CycleDrive_10_uphill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 10, 5, 0",
"200, 10, 5, 0",
"200, 10, 5, 0"
};
public static readonly string[] CycleDrive_10_downhill_5 = {
// <s>,<v>,<grad>,<stop>
" 0, 10, -5, 0",
" 200, 10, -5, 0",
" 200, 10, -5, 0"
};
public static readonly string[] CycleDrive_10_downhill_25 = {
// <s>, <v>, <grad>, <stop>
" 0, 10, -25, 0",
" 200, 10, -25, 0",
" 200, 10, -25, 0"
};
public static readonly string[] CycleDrive_10_uphill_25 = {
// <s>,<v>,<grad>,<stop>
" 0, 10, 25, 0",
" 200, 10, 25, 0",
" 200, 10, 25, 0"
};
public static readonly string[] CycleDrive_10_downhill_15 = {
// <s>, <v>, <grad>, <stop>
" 0, 10, -15, 0",
" 200, 10, -15, 0",
" 200, 10, -15, 0"
};
public static readonly string[] CycleDrive_10_uphill_15 = {
// <s>,<v>,<grad>,<stop>
" 0, 10, 15, 0",
" 200, 10, 15, 0",
" 200, 10, 15, 0"
};
#endregion
......@@ -431,7 +445,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 800, 80, 2, 0",
" 900, 80, 2.25, 0",
"1000, 80, 2.5, 0",
"1100, 80, 0, 0",
"1100, 80, 0, 0"
};
public static readonly string[] CycleDrive_50_Increasing_Slope = {
......@@ -447,7 +461,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 800, 50, 2, 0",
" 900, 50, 2.25, 0",
"1000, 50, 2.5, 0",
"1100, 50, 0, 0",
"1100, 50, 0, 0"
};
public static readonly string[] CycleDrive_30_Increasing_Slope = {
......@@ -463,7 +477,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 800, 30, 2, 0",
" 900, 30, 2.25, 0",
"1000, 30, 2.5, 0",
"1100, 30, 0, 0",
"1100, 30, 0, 0"
};
public static readonly string[] CycleDrive_80_Decreasing_Slope = {
......@@ -479,7 +493,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 800, 80, -2, 0",
" 900, 80, -2.25, 0",
"1000, 80, -2.5, 0",
"1100, 80, 0, 0",
"1100, 80, 0, 0"
};
public static readonly string[] CycleDrive_50_Decreasing_Slope = {
......@@ -495,7 +509,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 800, 50, -2, 0",
" 900, 50, -2.25, 0",
"1000, 50, -2.5, 0",
"1100, 50, 0, 0",
"1100, 50, 0, 0"
};
public static readonly string[] CycleDrive_30_Decreasing_Slope = {
......@@ -511,7 +525,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 800, 30, -2, 0",
" 900, 30, -2.25, 0",
"1000, 30, -2.5, 0",
"1100, 30, 0, 0",
"1100, 30, 0, 0"
};
public static readonly string[] CycleDrive_80_Dec_Increasing_Slope = {
......@@ -539,7 +553,7 @@ namespace TUGraz.VectoCore.Tests.Integration
"2000, 80, 2, 0",
"2100, 80, 2.25, 0",
"2200, 80, 2.5, 0",
"2300, 80, 0, 0",
"2300, 80, 0, 0"
};
public static readonly string[] CycleDrive_50_Dec_Increasing_Slope = {
......@@ -568,7 +582,7 @@ namespace TUGraz.VectoCore.Tests.Integration
"1050, 50, 2.25, 0",
"1100, 50, 2.5, 0",
"1150, 50, 5, 0",
"1200, 50, 0, 0",
"1200, 50, 0, 0"
};
public static readonly string[] CycleDrive_30_Dec_Increasing_Slope = {
......@@ -596,14 +610,14 @@ namespace TUGraz.VectoCore.Tests.Integration
"1000, 30, 2, 0",
"1050, 30, 2.25, 0",
"1100, 30, 2.5, 0",
"1150, 30, 0, 0",
"1150, 30, 0, 0"
};
public static readonly string[] CycleDecelerateWhileBrake_80_0_level = {
// <s>,<v>,<grad>,<stop>
" 0, 80, 0, 0",
" 990, 65, 0, 0",
"1000, 0, 0, 2",
"1000, 0, 0, 2"
};
public static readonly string[] CycleAccelerateWhileBrake_80_0_level = {
......@@ -611,7 +625,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 0, 80, 0, 0",
" 800, 90, 0, 0",
" 950, 80, 0, 0",
"1000, 0, 0, 2",
"1000, 0, 0, 2"
};
public static readonly string[] CycleAccelerateAtBrake_80_0_level = {
......@@ -619,7 +633,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 0, 80, 0, 0",
" 505, 90, 0, 0",
" 650, 80, 0, 0",
"1000, 0, 0, 2",
"1000, 0, 0, 2"
};
public static readonly string[] CycleAccelerateBeforeBrake_80_0_level = {
......@@ -627,7 +641,7 @@ namespace TUGraz.VectoCore.Tests.Integration
" 0, 80, 0, 0",
" 450, 90, 0, 0",
" 650, 80, 0, 0",
"1000, 0, 0, 2",
"1000, 0, 0, 2"
};
public static readonly string[] CycleDrive_stop_85_stop_85_level = {
......@@ -635,22 +649,9 @@ namespace TUGraz.VectoCore.Tests.Integration
" 0, 0, 0, 2",
"1000, 85, 0, 0",
"2000, 0, 0, 2",
"3000, 85, 0, 0",
"3000, 85, 0, 0"
};
#endregion
public static DrivingCycleData CreateCycleData(string[] entries)
{
var cycleData = new MemoryStream();
var writer = new StreamWriter(cycleData);
writer.WriteLine("<s>,<v>,<grad>,<stop>");
foreach (var entry in entries) {
writer.WriteLine(entry);
}
writer.Flush();
cycleData.Seek(0, SeekOrigin.Begin);
return DrivingCycleDataReader.ReadFromStream(cycleData, CycleType.DistanceBased);
}
}
}
\ No newline at end of file
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