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
6b226c2e
authored
Sep 05, 2019
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small changes before adapting for EDF
parent
9ea90201
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
9 deletions
+42
-9
src/main/java/mvd/jester/App.java
+1
-4
src/main/java/mvd/jester/priority/EarliestDeadineFirst.java
+29
-0
src/main/java/mvd/jester/priority/PriorityManager.java
+6
-3
src/main/java/mvd/jester/priority/RateMonotonic.java
+6
-0
src/main/java/mvd/jester/simulator/internals/schmidmottok/JobContext.java
+0
-2
No files found.
src/main/java/mvd/jester/App.java
View file @
6b226c2e
package
mvd
.
jester
;
package
mvd
.
jester
;
import
java.io.PrintWriter
;
import
mvd.jester.model.SystemSetup
;
import
mvd.jester.model.SystemSetup
;
import
mvd.jester.simulator.EventPrinter
;
import
mvd.jester.simulator.MaiaBertogna
;
import
mvd.jester.simulator.SchmidMottok
;
/**
/**
* Hello world!
* Hello world!
...
...
src/main/java/mvd/jester/priority/EarliestDeadineFirst.java
View file @
6b226c2e
package
mvd
.
jester
.
priority
;
import
mvd.jester.model.Task
;
import
mvd.jester.simulator.internals.TaskContextInterface
;
/**
* EarliestDeadineFirst
*/
public
class
EarliestDeadineFirst
implements
PriorityManager
{
/**
* Compare the priority of two tasks according to the Rate Monotonic policy
*
* @param t1 The first task
* @param t2 The second task
* @return 0 if both tasks have the same priority, positive number if the first task has a
* higher priority, negative number if the second task has a higher priority
*/
@Override
public
int
compare
(
Task
t1
,
Task
t2
)
{
throw
new
RuntimeException
(
"Earliest Deadline First does not have Priority Manager for tasks"
);
}
@Override
public
int
compare
(
TaskContextInterface
t1
,
TaskContextInterface
t2
)
{
return
(
int
)
(
t1
.
getDeadline
()
-
t2
.
getDeadline
());
}
}
src/main/java/mvd/jester/priority/PriorityManager.java
View file @
6b226c2e
package
mvd
.
jester
.
priority
;
package
mvd
.
jester
.
priority
;
import
java.util.Comparator
;
import
mvd.jester.model.Task
;
import
mvd.jester.model.Task
;
import
mvd.jester.simulator.internals.TaskContextInterface
;
/**
/**
* PriorityManager
* PriorityManager
*/
*/
public
interface
PriorityManager
extends
Comparator
<
Task
>
{
public
interface
PriorityManager
{
}
public
int
compare
(
Task
t1
,
Task
t2
);
public
int
compare
(
TaskContextInterface
t1
,
TaskContextInterface
t2
);
}
src/main/java/mvd/jester/priority/RateMonotonic.java
View file @
6b226c2e
package
mvd
.
jester
.
priority
;
package
mvd
.
jester
.
priority
;
import
mvd.jester.model.Task
;
import
mvd.jester.model.Task
;
import
mvd.jester.simulator.internals.TaskContextInterface
;
public
class
RateMonotonic
implements
PriorityManager
{
public
class
RateMonotonic
implements
PriorityManager
{
...
@@ -16,4 +17,9 @@ public class RateMonotonic implements PriorityManager {
...
@@ -16,4 +17,9 @@ public class RateMonotonic implements PriorityManager {
public
int
compare
(
Task
t1
,
Task
t2
)
{
public
int
compare
(
Task
t1
,
Task
t2
)
{
return
Long
.
compare
(
t1
.
getPeriod
(),
t2
.
getPeriod
());
return
Long
.
compare
(
t1
.
getPeriod
(),
t2
.
getPeriod
());
}
}
@Override
public
int
compare
(
TaskContextInterface
t1
,
TaskContextInterface
t2
)
{
return
Long
.
compare
(
t1
.
getTask
().
getPeriod
(),
t2
.
getTask
().
getPeriod
());
}
}
}
src/main/java/mvd/jester/simulator/internals/schmidmottok/JobContext.java
View file @
6b226c2e
...
@@ -18,7 +18,6 @@ public class JobContext implements JobContextInterface {
...
@@ -18,7 +18,6 @@ public class JobContext implements JobContextInterface {
private
final
long
wcet
;
private
final
long
wcet
;
private
Optional
<
ProcessorContext
>
currentProcessor
;
private
Optional
<
ProcessorContext
>
currentProcessor
;
private
Optional
<
TaskletContext
>
currentTasklet
;
private
Optional
<
TaskletContext
>
currentTasklet
;
private
long
executionTime
;
public
JobContext
(
TaskContext
taskContext
,
SegmentContext
segmentContext
)
{
public
JobContext
(
TaskContext
taskContext
,
SegmentContext
segmentContext
)
{
...
@@ -27,7 +26,6 @@ public class JobContext implements JobContextInterface {
...
@@ -27,7 +26,6 @@ public class JobContext implements JobContextInterface {
this
.
taskContext
=
taskContext
;
this
.
taskContext
=
taskContext
;
this
.
segmentContext
=
segmentContext
;
this
.
segmentContext
=
segmentContext
;
this
.
wcet
=
segmentContext
.
getSegment
().
getJobWcet
();
this
.
wcet
=
segmentContext
.
getSegment
().
getJobWcet
();
this
.
executionTime
=
wcet
;
}
}
public
Optional
<
TaskContextInterface
>
updateExecution
(
long
time
)
{
public
Optional
<
TaskContextInterface
>
updateExecution
(
long
time
)
{
...
...
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