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
0c7e7687
authored
Jul 18, 2019
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit before new tests
parent
956c2551
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
17 deletions
+50
-17
src/main/java/mvd/jester/tests/SchmidMottok.java
+50
-17
No files found.
src/main/java/mvd/jester/tests/SchmidMottok.java
View file @
0c7e7687
...
...
@@ -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,8 +51,10 @@ public class SchmidMottok extends AbstractTest {
for
(
Task
t
:
systemSetup
.
getTasks
())
{
if
(
t
.
getPeriod
()
<
task
.
getPeriod
())
{
interference
+=
Math
.
min
(
getTaskInterference
(
t
,
responseTime
),
responseTime
-
minimumWcet
+
1
);
for
(
int
p
=
0
;
p
<
numberOfProcessors
;
++
p
)
{
interference
+=
Math
.
min
(
getTaskInterference
(
t
,
responseTime
,
p
+
1
),
responseTime
-
minimumWcet
+
1
);
}
}
}
...
...
@@ -83,15 +86,45 @@ 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
);
// 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
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
;
}
}
return
interference
;
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;
//
}
}
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