Commit 4391562c by Michael Schmid

little work on simulator logger

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