Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
dbis
dbis-isochrone
isochrone
Commits
6f63004f
Commit
6f63004f
authored
10 years ago
by
Nikolaus Krismer
Browse files
Options
Downloads
Patches
Plain Diff
improved csv implementation
parent
6f2bbaa6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/it/unibz/inf/isochrone/network/AlgorithmRuntimeTest.java
+15
-4
15 additions, 4 deletions
.../it/unibz/inf/isochrone/network/AlgorithmRuntimeTest.java
with
15 additions
and
4 deletions
src/test/java/it/unibz/inf/isochrone/network/AlgorithmRuntimeTest.java
+
15
−
4
View file @
6f63004f
...
@@ -18,6 +18,7 @@ import java.util.Calendar;
...
@@ -18,6 +18,7 @@ import java.util.Calendar;
import
java.util.GregorianCalendar
;
import
java.util.GregorianCalendar
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -228,6 +229,8 @@ public final class AlgorithmRuntimeTest {
...
@@ -228,6 +229,8 @@ public final class AlgorithmRuntimeTest {
}
}
private
static
void
writeMapToCSV
(
final
File
file
,
final
Set
<
Entry
<
String
,
Map
<
String
,
Long
>>>
resultSet
,
final
int
repeatCount
)
{
private
static
void
writeMapToCSV
(
final
File
file
,
final
Set
<
Entry
<
String
,
Map
<
String
,
Long
>>>
resultSet
,
final
int
repeatCount
)
{
final
String
separator
=
";"
;
BufferedWriter
fw
=
null
;
BufferedWriter
fw
=
null
;
try
{
try
{
fw
=
new
BufferedWriter
(
new
PrintWriter
(
file
,
RESULTFILE_ENCODING
));
fw
=
new
BufferedWriter
(
new
PrintWriter
(
file
,
RESULTFILE_ENCODING
));
...
@@ -238,8 +241,12 @@ public final class AlgorithmRuntimeTest {
...
@@ -238,8 +241,12 @@ public final class AlgorithmRuntimeTest {
if
(
isFirstLine
)
{
if
(
isFirstLine
)
{
fw
.
write
(
"Runtime;"
);
fw
.
write
(
"Runtime;"
);
final
Set
<
String
>
algorithms
=
results
.
keySet
();
final
Set
<
String
>
algorithms
=
results
.
keySet
();
for
(
String
algorithmName
:
algorithms
)
{
final
Iterator
<
String
>
iter
=
algorithms
.
iterator
();
fw
.
write
(
algorithmName
+
";"
);
while
(
iter
.
hasNext
())
{
fw
.
write
(
iter
.
next
());
if
(
iter
.
hasNext
())
{
fw
.
write
(
separator
);
}
}
}
fw
.
newLine
();
fw
.
newLine
();
isFirstLine
=
false
;
isFirstLine
=
false
;
...
@@ -247,8 +254,12 @@ public final class AlgorithmRuntimeTest {
...
@@ -247,8 +254,12 @@ public final class AlgorithmRuntimeTest {
fw
.
write
(
time
+
";"
);
fw
.
write
(
time
+
";"
);
final
Set
<
Entry
<
String
,
Long
>>
timeSet
=
results
.
entrySet
();
final
Set
<
Entry
<
String
,
Long
>>
timeSet
=
results
.
entrySet
();
for
(
Entry
<
String
,
Long
>
entry
:
timeSet
)
{
final
Iterator
<
Entry
<
String
,
Long
>>
iter
=
timeSet
.
iterator
();
fw
.
write
((
entry
.
getValue
().
longValue
()
/
repeatCount
)
+
";"
);
while
(
iter
.
hasNext
())
{
fw
.
write
(
String
.
valueOf
(
iter
.
next
().
getValue
().
longValue
()
/
repeatCount
));
if
(
iter
.
hasNext
())
{
fw
.
write
(
separator
);
}
}
}
fw
.
newLine
();
fw
.
newLine
();
}
}
...
...
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