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