Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ttc18
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
stgroup
ttc18
Commits
d8d3e817
Commit
d8d3e817
authored
6 years ago
by
René Schöne
Browse files
Options
Downloads
Patches
Plain Diff
Fix missing solver name when writing out result file.
parent
7c0cb933
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jastadd-mquat-benchmark/src/main/java/de/tudresden/inf/st/mquat/benchmark/FullBenchmarkMain.java
+9
-5
9 additions, 5 deletions
...e/tudresden/inf/st/mquat/benchmark/FullBenchmarkMain.java
with
9 additions
and
5 deletions
jastadd-mquat-benchmark/src/main/java/de/tudresden/inf/st/mquat/benchmark/FullBenchmarkMain.java
+
9
−
5
View file @
d8d3e817
...
@@ -5,6 +5,7 @@ import de.tudresden.inf.st.mquat.data.TestGeneratorSettings;
...
@@ -5,6 +5,7 @@ import de.tudresden.inf.st.mquat.data.TestGeneratorSettings;
import
de.tudresden.inf.st.mquat.benchmark.data.BenchmarkSettings
;
import
de.tudresden.inf.st.mquat.benchmark.data.BenchmarkSettings
;
import
de.tudresden.inf.st.mquat.benchmark.data.ScenarioData
;
import
de.tudresden.inf.st.mquat.benchmark.data.ScenarioData
;
import
de.tudresden.inf.st.mquat.benchmark.data.ScenarioSettings
;
import
de.tudresden.inf.st.mquat.benchmark.data.ScenarioSettings
;
import
de.tudresden.inf.st.mquat.jastadd.model.Tuple
;
import
de.tudresden.inf.st.mquat.solving.BenchmarkableSolver
;
import
de.tudresden.inf.st.mquat.solving.BenchmarkableSolver
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -50,7 +51,7 @@ public class FullBenchmarkMain {
...
@@ -50,7 +51,7 @@ public class FullBenchmarkMain {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
// create a settings file for each solver
// create a settings file for each solver
List
<
Path
>
pathList
=
new
ArrayList
<>();
List
<
Tuple
<
Path
,
String
>
>
pathList
=
new
ArrayList
<>();
for
(
String
solverName
:
this
.
settings
.
solvers
)
{
for
(
String
solverName
:
this
.
settings
.
solvers
)
{
settings
.
solvers
=
Collections
.
singletonList
(
solverName
);
settings
.
solvers
=
Collections
.
singletonList
(
solverName
);
Path
tempPath
;
Path
tempPath
;
...
@@ -61,9 +62,11 @@ public class FullBenchmarkMain {
...
@@ -61,9 +62,11 @@ public class FullBenchmarkMain {
logger
.
catching
(
e
);
logger
.
catching
(
e
);
throw
new
RuntimeException
(
"Could not create temporary file for sandBoxed use. Exiting."
);
throw
new
RuntimeException
(
"Could not create temporary file for sandBoxed use. Exiting."
);
}
}
pathList
.
add
(
tempPath
);
pathList
.
add
(
new
Tuple
<>(
tempPath
,
solverName
)
);
}
}
nextSolver:
for
(
Path
path
:
pathList
)
{
nextSolver:
for
(
Tuple
<
Path
,
String
>
tuple
:
pathList
)
{
Path
path
=
tuple
.
getFirstElement
();
String
solverName
=
tuple
.
getSecondElement
();
for
(
int
i
=
0
;
i
<
this
.
repetitions
;
i
++)
{
for
(
int
i
=
0
;
i
<
this
.
repetitions
;
i
++)
{
if
(
useGradleConnection
)
{
if
(
useGradleConnection
)
{
// invoke Gradle target directly
// invoke Gradle target directly
...
@@ -98,7 +101,7 @@ public class FullBenchmarkMain {
...
@@ -98,7 +101,7 @@ public class FullBenchmarkMain {
// wait for the process to actually end
// wait for the process to actually end
p
.
waitFor
();
p
.
waitFor
();
// write out csv entry, if the process is terminated this way
// write out csv entry, if the process is terminated this way
StringBuilder
sb
=
createRow
();
StringBuilder
sb
=
createRow
(
solverName
);
Path
resultFile
=
getResultFilePath
(
""
);
Path
resultFile
=
getResultFilePath
(
""
);
logger
.
info
(
"Writing out to {}"
,
resultFile
);
logger
.
info
(
"Writing out to {}"
,
resultFile
);
try
(
BufferedWriter
writer
=
Files
.
newBufferedWriter
(
resultFile
,
try
(
BufferedWriter
writer
=
Files
.
newBufferedWriter
(
resultFile
,
...
@@ -125,7 +128,7 @@ public class FullBenchmarkMain {
...
@@ -125,7 +128,7 @@ public class FullBenchmarkMain {
}
}
}
}
StringBuilder
createRow
()
{
StringBuilder
createRow
(
String
solverName
)
{
StringBuilder
sb
=
new
StringBuilder
(
makeNow
()).
append
(
SEPARATOR
);
StringBuilder
sb
=
new
StringBuilder
(
makeNow
()).
append
(
SEPARATOR
);
return
sb
.
append
(
0
).
append
(
SEPARATOR
)
return
sb
.
append
(
0
).
append
(
SEPARATOR
)
.
append
(
settings
.
basic
.
minTopLevelComponents
).
append
(
SEPARATOR
)
.
append
(
settings
.
basic
.
minTopLevelComponents
).
append
(
SEPARATOR
)
...
@@ -143,6 +146,7 @@ public class FullBenchmarkMain {
...
@@ -143,6 +146,7 @@ public class FullBenchmarkMain {
.
append
(-
1
).
append
(
SEPARATOR
)
// model.numImplementations
.
append
(-
1
).
append
(
SEPARATOR
)
// model.numImplementations
.
append
(-
1
).
append
(
SEPARATOR
)
// modelGeneration
.
append
(-
1
).
append
(
SEPARATOR
)
// modelGeneration
.
append
(-
1
).
append
(
SEPARATOR
)
// initialObjective
.
append
(-
1
).
append
(
SEPARATOR
)
// initialObjective
.
append
(
solverName
).
append
(
SEPARATOR
)
.
append
(-
1
).
append
(
SEPARATOR
)
// generation time
.
append
(-
1
).
append
(
SEPARATOR
)
// generation time
.
append
(-
1
).
append
(
SEPARATOR
)
// solving time
.
append
(-
1
).
append
(
SEPARATOR
)
// solving time
.
append
(-
1
).
append
(
SEPARATOR
)
// objective
.
append
(-
1
).
append
(
SEPARATOR
)
// objective
...
...
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