Commit d8d3e817 authored by René Schöne's avatar René Schöne
Browse files

Fix missing solver name when writing out result file.

parent 7c0cb933
......@@ -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.ScenarioData;
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 org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -50,7 +51,7 @@ public class FullBenchmarkMain {
@Override
public void run() {
// 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) {
settings.solvers = Collections.singletonList(solverName);
Path tempPath;
......@@ -61,9 +62,11 @@ public class FullBenchmarkMain {
logger.catching(e);
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++) {
if (useGradleConnection) {
// invoke Gradle target directly
......@@ -98,7 +101,7 @@ public class FullBenchmarkMain {
// wait for the process to actually end
p.waitFor();
// write out csv entry, if the process is terminated this way
StringBuilder sb = createRow();
StringBuilder sb = createRow(solverName);
Path resultFile = getResultFilePath("");
logger.info("Writing out to {}", resultFile);
try (BufferedWriter writer = Files.newBufferedWriter(resultFile,
......@@ -125,7 +128,7 @@ public class FullBenchmarkMain {
}
}
StringBuilder createRow() {
StringBuilder createRow(String solverName) {
StringBuilder sb = new StringBuilder(makeNow()).append(SEPARATOR);
return sb.append(0).append(SEPARATOR)
.append(settings.basic.minTopLevelComponents).append(SEPARATOR)
......@@ -143,6 +146,7 @@ public class FullBenchmarkMain {
.append(-1).append(SEPARATOR) // model.numImplementations
.append(-1).append(SEPARATOR) // modelGeneration
.append(-1).append(SEPARATOR) // initialObjective
.append(solverName).append(SEPARATOR)
.append(-1).append(SEPARATOR) // generation time
.append(-1).append(SEPARATOR) // solving time
.append(-1).append(SEPARATOR) // objective
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment