Commit 0c7e7687 by Michael Schmid

Commit before new tests

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