Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
jester
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9e4cddba
authored
Jul 24, 2019
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Last changes to SchmidMottok and a few little ones
parent
0c7e7687
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
30 deletions
+15
-30
src/main/java/mvd/jester/model/Segment.java
+4
-2
src/main/java/mvd/jester/tests/SchmidMottok.java
+10
-27
src/main/java/mvd/jester/tests/TestEnvironment.java
+1
-1
No files found.
src/main/java/mvd/jester/model/Segment.java
View file @
9e4cddba
...
...
@@ -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
;
}
}
...
...
src/main/java/mvd/jester/tests/SchmidMottok.java
View file @
9e4cddba
...
...
@@ -47,18 +47,21 @@ public class SchmidMottok extends AbstractTest {
do
{
previousResponseTime
=
responseTime
;
long
i
nterference
=
0
;
double
taskI
nterference
=
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;
// }
}
src/main/java/mvd/jester/tests/TestEnvironment.java
View file @
9e4cddba
...
...
@@ -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
!"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment