Code development platform for open source projects from the European Union institutions
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Vecto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefanos DOUMPOULAKIS
Vecto
Commits
26775cee
Commit
26775cee
authored
9 years ago
by
Markus Quaritsch
Browse files
Options
Downloads
Patches
Plain Diff
no message
parent
9dc2f9ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VectoCoreTest/Integration/SimpleDrivingCycles.cs
+87
-86
87 additions, 86 deletions
VectoCoreTest/Integration/SimpleDrivingCycles.cs
with
87 additions
and
86 deletions
VectoCoreTest/Integration/SimpleDrivingCycles.cs
+
87
−
86
View file @
26775cee
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment