Commit 4391562c by Michael Schmid

little work on simulator logger

parent ece7d61d
......@@ -3,7 +3,6 @@ package mvd.jester;
import mvd.jester.model.SystemSetup;
import mvd.jester.priority.EarliestDeadlineFirst;
import mvd.jester.priority.RateMonotonic;
import mvd.jester.tests.ChwaLee;
/**
......@@ -22,11 +21,11 @@ public class App {
te.registerTest(mvd.jester.tests.MaiaBertogna.class);
te.registerTest(mvd.jester.tests.ChwaLee.class);
// te.registerSimulator(mvd.jester.simulator.MaiaBertogna.class);
// te.registerSimulator(mvd.jester.simulator.SchmidMottok.class);
te.registerSimulator(mvd.jester.simulator.MaiaBertogna.class);
te.registerSimulator(mvd.jester.simulator.SchmidMottok.class);
te.runTests();
te.runExperiments();
// SystemSetup setup = SystemSetup.readFromFile(
// "/home/mike/Promotion/projects/eclipse/jester/results/test_this.txt", 16);
......
......@@ -11,6 +11,7 @@ import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import mvd.jester.simulator.AbstractSimulator;
import mvd.jester.tests.AbstractTest;
import mvd.jester.utils.Logger;
......@@ -25,26 +26,22 @@ public class ResultLogger {
this.numberOfProcessors = numberOfProcessors;
}
// public void logAll() {
// if (!testResults.isEmpty()) {
// logFeasibility(testResults, "test");
// logFeasibilityRatio(testResults, "test");
// logTardinessStatistics(testResults, "test");
// logFailedTardiness(testResults, "test");
// }
// if (!simulatorResults.isEmpty()) {
// logFeasibility(simulatorResults, "sim");
// logFeasibilityRatio(simulatorResults, "sim");
// logTardinessStatistics(simulatorResults, "sim");
// logFailedTardiness(simulatorResults, "sim");
// }
// }
public void logAll(Set<ResultCollector<AbstractTest>> testResults,
Set<ResultCollector<AbstractSimulator>> simResults) {
logTests(testResults);
logSimulations(simResults);
}
public void logTests(Set<ResultCollector<AbstractTest>> results) {
logFeasibility(results, "test");
logTaskRatio(results, "test");
}
public void logSimulations(Set<ResultCollector<AbstractSimulator>> results) {
logFeasibility(results, "sim");
logTaskRatio(results, "sim");
}
public <T extends TypeInterface> void logFeasibility(Set<ResultCollector<T>> results,
String type) {
LocalTime date = LocalTime.now();
......
......@@ -73,7 +73,7 @@ public class TestEnvironment {
return this;
}
public void runTests() {
public void runExperiments() {
Set<ResultCollector<AbstractTest>> abstractTestInstances = new HashSet<>();
Set<ResultCollector<AbstractSimulator>> abstractSimulatorInstances = new HashSet<>();
......@@ -105,7 +105,8 @@ public class TestEnvironment {
}
long checkedTasksets = 0;
System.out.print(Math.round((double) checkedTasksets / numberOfTaskSets * 100) + "% of "
+ numberOfTaskSets + " tasksets tested!\r");
while (checkedTasksets < numberOfTaskSets) {
builder.rebuild(this.systemSetup);
......@@ -115,7 +116,7 @@ public class TestEnvironment {
&& checkedTasksets < numberOfTaskSets) {
checkedTasksets++;
if (checkedTasksets % 100 == 0) {
if (checkedTasksets % 10 == 0) {
System.out.print(Math.round((double) checkedTasksets / numberOfTaskSets * 100)
+ "% of " + numberOfTaskSets + " tasksets tested!\r");
}
......@@ -147,6 +148,7 @@ public class TestEnvironment {
ResultLogger resultLogger = new ResultLogger(systemSetup.getNumberOfProcessors());
resultLogger.logTests(abstractTestInstances);
resultLogger.logSimulations(abstractSimulatorInstances);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment