Commit 9e4cddba by Michael Schmid

Last changes to SchmidMottok and a few little ones

parent 0c7e7687
......@@ -16,8 +16,10 @@ public class Segment {
this.taskletWcet = this.jobWcet;
this.numberOfTasklets = this.numberOfJobs;
} else {
this.taskletWcet = LongMath.gcd(jobWcet, numberOfJobs);
this.numberOfTasklets = this.jobWcet * this.numberOfJobs / this.taskletWcet;
// this.taskletWcet = LongMath.gcd(jobWcet, numberOfJobs);
// this.numberOfTasklets = this.jobWcet * this.numberOfJobs / this.taskletWcet;
this.taskletWcet = numberOfJobs;
this.numberOfTasklets = jobWcet;
}
}
......
......@@ -47,18 +47,21 @@ public class SchmidMottok extends AbstractTest {
do {
previousResponseTime = responseTime;
long interference = 0;
double taskInterference = 0;
for (Task t : systemSetup.getTasks()) {
if (t.getPeriod() < task.getPeriod()) {
for (int p = 0; p < numberOfProcessors; ++p) {
interference += Math.min(getTaskInterference(t, responseTime, p + 1),
long numberOfJobs =
t.getMaximumParallelism() > numberOfProcessors ? numberOfProcessors
: t.getMaximumParallelism();
for (int p = 0; p < numberOfJobs; ++p) {
taskInterference += Math.min(getTaskInterference(t, responseTime, p + 1),
responseTime - minimumWcet + 1);
}
}
}
double taskInterference = (double) interference / systemSetup.getNumberOfProcessors();
taskInterference /= numberOfProcessors;
double selfInterference = getSelfInterference(task);
long totalInterference = (long) Math.floor(taskInterference + selfInterference);
......@@ -66,7 +69,6 @@ public class SchmidMottok extends AbstractTest {
responseTime = minimumWcet + totalInterference;
} while (previousResponseTime != responseTime);
return responseTime;
}
......@@ -86,22 +88,13 @@ public class SchmidMottok extends AbstractTest {
return interference;
}
// 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 numberOfProcessors = systemSetup.getNumberOfProcessors();
long amountOfJobs =
(LongMath.divide(interval + responseTime - minWcet, period, RoundingMode.FLOOR)
+ 1);
......@@ -109,12 +102,9 @@ public class SchmidMottok extends AbstractTest {
double workload = 0;
for (Segment s : task.getSegments()) {
long numberOfJobs = s.getNumberOfJobs() > systemSetup.getNumberOfProcessors()
? systemSetup.getNumberOfProcessors()
long numberOfJobs = s.getNumberOfJobs() > numberOfProcessors ? numberOfProcessors
: s.getNumberOfJobs();
if (numberOfJobs >= parallelism) {
// workload += LongMath.divide(s.getNumberOfTasklets(), numberOfJobs,
// RoundingMode.CEILING) * s.getTaskletWcet();
workload += s.getNumberOfTasklets() * s.getTaskletWcet() / numberOfJobs;
}
}
......@@ -129,6 +119,7 @@ public class SchmidMottok extends AbstractTest {
private long getMinimumWcet(Task task) {
long minWcet = 0;
for (Segment s : task.getSegments()) {
minWcet += s.getTaskletWcet();
}
......@@ -136,12 +127,4 @@ 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();
// }
// return maxWcet;
// }
}
......@@ -46,7 +46,7 @@ public class TestEnvironment {
try {
testCases.add(t.newInstance(this.systemSetup));
} catch (Exception e) {
System.out.println("Ahhh SHIT!");
System.out.println("Could not instantiate object of AbstractTest!");
}
}
......
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