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
ece7d61d
authored
Jan 21, 2020
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes
parent
d255848d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
10 deletions
+32
-10
src/main/java/mvd/jester/model/SystemSetup.java
+13
-9
src/test/java/mvd/jester/model/TestSystemSetup.java
+1
-1
src/test/java/mvd/jester/tests/TestMaiaBertogna.java
+18
-0
No files found.
src/main/java/mvd/jester/model/SystemSetup.java
View file @
ece7d61d
...
@@ -102,7 +102,8 @@ public class SystemSetup {
...
@@ -102,7 +102,8 @@ public class SystemSetup {
public
static
class
Builder
{
public
static
class
Builder
{
private
long
numberOfProcessors
=
4
;
private
long
numberOfProcessors
=
4
;
private
long
minPeriod
=
100
;
private
long
minPeriod
=
100
;
private
long
maxPeriod
=
1000
;
private
long
maxSequentialPeriod
=
1000
;
private
long
maxParallelPeriod
=
10000
;
private
long
minNumberOfSegments
=
3
;
private
long
minNumberOfSegments
=
3
;
private
long
maxNumberOfSegments
=
7
;
private
long
maxNumberOfSegments
=
7
;
private
long
minNumberOfJobs
=
2
;
private
long
minNumberOfJobs
=
2
;
...
@@ -115,11 +116,12 @@ public class SystemSetup {
...
@@ -115,11 +116,12 @@ public class SystemSetup {
}
}
private
long
randomTaskPeriod
(
boolean
serial
)
{
private
long
randomSequentialTaskPeriod
()
{
if
(
serial
)
return
ThreadLocalRandom
.
current
().
nextLong
(
minPeriod
,
maxSequentialPeriod
);
return
ThreadLocalRandom
.
current
().
nextLong
(
minPeriod
,
maxPeriod
);
}
else
return
ThreadLocalRandom
.
current
().
nextLong
(
minPeriod
,
maxPeriod
/* * 10 */
);
private
long
randomParallelTaskPeriod
()
{
return
ThreadLocalRandom
.
current
().
nextLong
(
minPeriod
,
maxParallelPeriod
);
}
}
private
long
randomTaskRatio
(
long
min
)
{
private
long
randomTaskRatio
(
long
min
)
{
...
@@ -143,7 +145,7 @@ public class SystemSetup {
...
@@ -143,7 +145,7 @@ public class SystemSetup {
private
Task
generateTask
()
{
private
Task
generateTask
()
{
boolean
serial
=
randomTaskRatio
(
0
)
>
this
.
ratio
;
boolean
serial
=
randomTaskRatio
(
0
)
>
this
.
ratio
;
long
period
=
randomTaskPeriod
(
serial
);
long
period
=
serial
?
randomSequentialTaskPeriod
()
:
randomParallelTaskPeriod
(
);
long
numberOfSegments
=
serial
?
1
:
randomNumberOfSegments
();
long
numberOfSegments
=
serial
?
1
:
randomNumberOfSegments
();
long
parallelNumberOfJobs
=
serial
?
1
:
randomNumberOfJobs
();
long
parallelNumberOfJobs
=
serial
?
1
:
randomNumberOfJobs
();
Set
<
Segment
>
segments
=
new
LinkedHashSet
<
Segment
>();
Set
<
Segment
>
segments
=
new
LinkedHashSet
<
Segment
>();
...
@@ -195,9 +197,11 @@ public class SystemSetup {
...
@@ -195,9 +197,11 @@ public class SystemSetup {
return
this
;
return
this
;
}
}
public
Builder
setPeriods
(
long
minPeriod
,
long
maxPeriod
)
{
public
Builder
setPeriods
(
long
minPeriod
,
long
maxSequentialPeriod
,
long
maxParallelPeriod
)
{
this
.
minPeriod
=
minPeriod
;
this
.
minPeriod
=
minPeriod
;
this
.
maxPeriod
=
maxPeriod
;
this
.
maxSequentialPeriod
=
maxSequentialPeriod
;
this
.
maxParallelPeriod
=
maxParallelPeriod
;
return
this
;
return
this
;
}
}
...
...
src/test/java/mvd/jester/model/TestSystemSetup.java
View file @
ece7d61d
...
@@ -15,7 +15,7 @@ public class TestSystemSetup {
...
@@ -15,7 +15,7 @@ public class TestSystemSetup {
for
(
int
i
=
0
;
i
<
NUMBER_OF_SETS
;
++
i
)
{
for
(
int
i
=
0
;
i
<
NUMBER_OF_SETS
;
++
i
)
{
SystemSetup
taskSet
=
new
SystemSetup
.
Builder
().
setNumberOfSegments
(
1
,
7
)
SystemSetup
taskSet
=
new
SystemSetup
.
Builder
().
setNumberOfSegments
(
1
,
7
)
.
setNumberOfJobs
(
2
,
10
).
setPeriods
(
100
,
1000
).
build
();
.
setNumberOfJobs
(
2
,
10
).
setPeriods
(
100
,
1000
,
1000
).
build
();
for
(
Task
t
:
taskSet
.
getTasks
())
{
for
(
Task
t
:
taskSet
.
getTasks
())
{
assertTrue
(
t
.
getPeriod
()
>=
100
);
assertTrue
(
t
.
getPeriod
()
>=
100
);
...
...
src/test/java/mvd/jester/tests/TestMaiaBertogna.java
0 → 100644
View file @
ece7d61d
package
mvd
.
jester
.
tests
;
import
org.junit.jupiter.api.DisplayName
;
import
org.junit.jupiter.api.Test
;
import
mvd.jester.model.SystemSetup
;
/**
* TestMaiaBertogna
*/
public
class
TestMaiaBertogna
{
@Test
@DisplayName
(
"Check if the schedulability check returns the correct values."
)
public
void
testRunSchedulabilityCheck
()
{
SystemSetup
systemSetup
=
SystemSetup
.
readFromFile
(
"/resources/Taskset1.txt"
,
0
);
MaiaBertogna
mb
=
new
MaiaBertogna
(
systemSetup
);
}
}
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