Commit 0c7e7687 by Michael Schmid

Commit before new tests

parent 956c2551
...@@ -43,6 +43,7 @@ public class SchmidMottok extends AbstractTest { ...@@ -43,6 +43,7 @@ public class SchmidMottok extends AbstractTest {
long minimumWcet = getMinimumWcet(task); long minimumWcet = getMinimumWcet(task);
long responseTime = minimumWcet; long responseTime = minimumWcet;
long previousResponseTime = 0; long previousResponseTime = 0;
long numberOfProcessors = systemSetup.getNumberOfProcessors();
do { do {
previousResponseTime = responseTime; previousResponseTime = responseTime;
...@@ -50,10 +51,12 @@ public class SchmidMottok extends AbstractTest { ...@@ -50,10 +51,12 @@ public class SchmidMottok extends AbstractTest {
for (Task t : systemSetup.getTasks()) { for (Task t : systemSetup.getTasks()) {
if (t.getPeriod() < task.getPeriod()) { if (t.getPeriod() < task.getPeriod()) {
interference += Math.min(getTaskInterference(t, responseTime), for (int p = 0; p < numberOfProcessors; ++p) {
interference += Math.min(getTaskInterference(t, responseTime, p + 1),
responseTime - minimumWcet + 1); responseTime - minimumWcet + 1);
} }
} }
}
double taskInterference = (double) interference / systemSetup.getNumberOfProcessors(); double taskInterference = (double) interference / systemSetup.getNumberOfProcessors();
double selfInterference = getSelfInterference(task); double selfInterference = getSelfInterference(task);
...@@ -83,15 +86,45 @@ public class SchmidMottok extends AbstractTest { ...@@ -83,15 +86,45 @@ public class SchmidMottok extends AbstractTest {
return interference; return interference;
} }
private long getTaskInterference(Task task, long interval) { // private long getTaskInterference(Task task, long interval) {
// long responseTime = responseTimes.get(task);
// long minWcet = getMinimumWcet(task);
// long period = task.getPeriod();
// long interference =
// (LongMath.divide(interval + responseTime - minWcet, period, RoundingMode.FLOOR) + 1)
// * getMaximumWcet(task);
// return interference;
// }
private double getTaskInterference(Task task, long interval, long parallelism) {
if (responseTimes.containsKey(task)) {
long responseTime = responseTimes.get(task); long responseTime = responseTimes.get(task);
long minWcet = getMinimumWcet(task); long minWcet = getMinimumWcet(task);
long period = task.getPeriod(); long period = task.getPeriod();
long interference = long amountOfJobs =
(LongMath.divide(interval + responseTime - minWcet, period, RoundingMode.FLOOR) + 1) (LongMath.divide(interval + responseTime - minWcet, period, RoundingMode.FLOOR)
* getMaximumWcet(task); + 1);
double workload = 0;
for (Segment s : task.getSegments()) {
long numberOfJobs = s.getNumberOfJobs() > systemSetup.getNumberOfProcessors()
? systemSetup.getNumberOfProcessors()
: s.getNumberOfJobs();
if (numberOfJobs >= parallelism) {
// workload += LongMath.divide(s.getNumberOfTasklets(), numberOfJobs,
// RoundingMode.CEILING) * s.getTaskletWcet();
workload += s.getNumberOfTasklets() * s.getTaskletWcet() / numberOfJobs;
}
}
double interference = amountOfJobs * workload;
return interference; return interference;
} else {
throw new RuntimeException("Task was not found in task set!");
}
} }
private long getMinimumWcet(Task task) { private long getMinimumWcet(Task task) {
...@@ -103,12 +136,12 @@ public class SchmidMottok extends AbstractTest { ...@@ -103,12 +136,12 @@ public class SchmidMottok extends AbstractTest {
return minWcet; return minWcet;
} }
private long getMaximumWcet(Task task) { // private long getMaximumWcet(Task task) {
long maxWcet = 0; // long maxWcet = 0;
for (Segment s : task.getSegments()) { // for (Segment s : task.getSegments()) {
maxWcet += s.getTaskletWcet() * s.getNumberOfTasklets(); // maxWcet += s.getTaskletWcet() * s.getNumberOfTasklets();
} // }
return maxWcet; // return maxWcet;
} // }
} }
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