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
19007890
authored
Jul 31, 2019
by
Michael Schmid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
found bug, MaiaBertogna Sim works now
parent
11c72917
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
48 deletions
+26
-48
src/main/java/mvd/jester/App.java
+6
-29
src/main/java/mvd/jester/TestEnvironment.java
+5
-10
src/main/java/mvd/jester/simulator/AbstractSimulator.java
+8
-1
src/main/java/mvd/jester/simulator/MaiaBertogna.java
+1
-1
src/main/java/mvd/jester/tests/AbstractTest.java
+4
-1
src/main/java/mvd/jester/tests/MaiaBertogna.java
+1
-3
src/main/java/mvd/jester/tests/SchmidMottok.java
+1
-3
No files found.
src/main/java/mvd/jester/App.java
View file @
19007890
...
@@ -9,39 +9,16 @@ import mvd.jester.model.SystemSetup;
...
@@ -9,39 +9,16 @@ import mvd.jester.model.SystemSetup;
*/
*/
public
class
App
{
public
class
App
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
boolean
runTests
=
false
;
SystemSetup
.
Builder
builder
=
new
SystemSetup
.
Builder
().
setNumberOfProcessors
(
8
);
if
(
runTests
)
{
SystemSetup
.
Builder
builder
=
new
SystemSetup
.
Builder
().
setNumberOfProcessors
(
8
);
TestEnvironment
te
=
new
TestEnvironment
(
builder
,
40000
);
TestEnvironment
te
=
new
TestEnvironment
(
builder
,
40000
);
// te.registerTestInterface(SchmidMottok.class);
te
.
registerTestPair
(
mvd
.
jester
.
tests
.
MaiaBertogna
.
class
,
mvd
.
jester
.
simulator
.
MaiaBertogna
.
class
);
// te.registerTestInterface(SchmidMottok.class);
te
.
registerTestPair
(
mvd
.
jester
.
tests
.
MaiaBertogna
.
class
,
mvd
.
jester
.
simulator
.
MaiaBertogna
.
class
);
te
.
runTests
();
}
else
{
File
folder
=
new
File
(
"results"
);
for
(
File
f
:
folder
.
listFiles
())
{
SystemSetup
systemSetup
=
SystemSetup
.
fromFile
(
f
.
toPath
().
toString
());
mvd
.
jester
.
simulator
.
MaiaBertogna
mb_sim
=
new
mvd
.
jester
.
simulator
.
MaiaBertogna
(
systemSetup
);
mvd
.
jester
.
tests
.
MaiaBertogna
mb_test
=
new
mvd
.
jester
.
tests
.
MaiaBertogna
(
systemSetup
);
boolean
simCheck
=
mb_sim
.
runSimulation
();
boolean
schedCheck
=
mb_test
.
runSchedulabilityCheck
();
if
(
simCheck
==
false
&&
schedCheck
==
true
)
{
System
.
out
.
println
(
f
.
getName
());
}
}
}
te
.
runTests
();
}
}
}
}
src/main/java/mvd/jester/TestEnvironment.java
View file @
19007890
...
@@ -90,16 +90,11 @@ public class TestEnvironment {
...
@@ -90,16 +90,11 @@ public class TestEnvironment {
.
compute
(
kv
.
getValue
(),
(
k
,
v
)
->
(
v
==
null
)
?
1
:
v
+
1
);
.
compute
(
kv
.
getValue
(),
(
k
,
v
)
->
(
v
==
null
)
?
1
:
v
+
1
);
}
}
if
(
schedCheck
==
true
&&
simCheck
==
false
)
{
if
(
schedCheck
==
true
&&
simCheck
==
false
)
{
boolean
sched
=
kv
.
getKey
().
runSchedulabilityCheck
();
try
(
PrintWriter
out
=
boolean
sim
=
kv
.
getValue
().
runSimulation
();
new
PrintWriter
(
"results/manualCheck"
+
checkedTasksets
+
".txt"
))
{
out
.
println
(
systemSetup
);
if
(
sched
==
true
&&
sim
==
false
)
{
}
catch
(
Exception
e
)
{
try
(
PrintWriter
out
=
new
PrintWriter
(
System
.
out
.
println
(
"Ähm something went horribly wrong!"
);
"results/manualCheck"
+
checkedTasksets
+
".txt"
))
{
out
.
println
(
systemSetup
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"Ähm something went horribly wrong!"
);
}
}
}
}
}
}
}
...
...
src/main/java/mvd/jester/simulator/AbstractSimulator.java
View file @
19007890
...
@@ -19,7 +19,7 @@ public abstract class AbstractSimulator implements SimulatorInterface {
...
@@ -19,7 +19,7 @@ public abstract class AbstractSimulator implements SimulatorInterface {
protected
final
SystemSetup
systemSetup
;
protected
final
SystemSetup
systemSetup
;
protected
final
Set
<
ProcessorContext
>
processors
;
protected
final
Set
<
ProcessorContext
>
processors
;
protected
final
SortedTaskContextSet
readyTasks
;
protected
final
SortedTaskContextSet
readyTasks
;
protected
final
long
hyperPeriod
;
protected
long
hyperPeriod
;
AbstractSimulator
(
SystemSetup
systemSetup
)
{
AbstractSimulator
(
SystemSetup
systemSetup
)
{
this
.
systemSetup
=
systemSetup
;
this
.
systemSetup
=
systemSetup
;
...
@@ -32,6 +32,13 @@ public abstract class AbstractSimulator implements SimulatorInterface {
...
@@ -32,6 +32,13 @@ public abstract class AbstractSimulator implements SimulatorInterface {
// LongMath.pow(systemSetup.getTasks().last().getPeriod(), 2);
// LongMath.pow(systemSetup.getTasks().last().getPeriod(), 2);
}
}
protected
void
init
()
{
this
.
readyTasks
.
clear
();
for
(
ProcessorContext
p
:
processors
)
{
p
.
setJob
(
null
);
}
this
.
hyperPeriod
=
systemSetup
.
getTasks
().
last
().
getPeriod
()
*
10
;
}
protected
boolean
releaseTasks
(
long
timeStep
)
{
protected
boolean
releaseTasks
(
long
timeStep
)
{
for
(
Task
t
:
systemSetup
.
getTasks
())
{
for
(
Task
t
:
systemSetup
.
getTasks
())
{
...
...
src/main/java/mvd/jester/simulator/MaiaBertogna.java
View file @
19007890
...
@@ -18,7 +18,7 @@ public class MaiaBertogna extends AbstractSimulator {
...
@@ -18,7 +18,7 @@ public class MaiaBertogna extends AbstractSimulator {
@Override
@Override
public
boolean
runSimulation
()
{
public
boolean
runSimulation
()
{
readyTasks
.
clear
();
init
();
for
(
int
t
=
0
;
t
<
hyperPeriod
;
++
t
)
{
for
(
int
t
=
0
;
t
<
hyperPeriod
;
++
t
)
{
if
(!
releaseTasks
(
t
))
{
if
(!
releaseTasks
(
t
))
{
return
false
;
return
false
;
...
...
src/main/java/mvd/jester/tests/AbstractTest.java
View file @
19007890
...
@@ -2,6 +2,7 @@ package mvd.jester.tests;
...
@@ -2,6 +2,7 @@ package mvd.jester.tests;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
mvd.jester.model.SystemSetup
;
import
mvd.jester.model.Task
;
import
mvd.jester.model.Task
;
/**
/**
...
@@ -10,8 +11,10 @@ import mvd.jester.model.Task;
...
@@ -10,8 +11,10 @@ import mvd.jester.model.Task;
public
abstract
class
AbstractTest
implements
TestInterface
{
public
abstract
class
AbstractTest
implements
TestInterface
{
protected
final
Map
<
Task
,
Long
>
responseTimes
;
protected
final
Map
<
Task
,
Long
>
responseTimes
;
protected
final
SystemSetup
systemSetup
;
public
AbstractTest
()
{
public
AbstractTest
(
SystemSetup
systemSetup
)
{
this
.
systemSetup
=
systemSetup
;
this
.
responseTimes
=
new
HashMap
<
Task
,
Long
>();
this
.
responseTimes
=
new
HashMap
<
Task
,
Long
>();
}
}
}
}
src/main/java/mvd/jester/tests/MaiaBertogna.java
View file @
19007890
...
@@ -12,10 +12,8 @@ import mvd.jester.model.SystemSetup;
...
@@ -12,10 +12,8 @@ import mvd.jester.model.SystemSetup;
*/
*/
public
class
MaiaBertogna
extends
AbstractTest
{
public
class
MaiaBertogna
extends
AbstractTest
{
private
final
SystemSetup
systemSetup
;
public
MaiaBertogna
(
SystemSetup
systemSetup
)
{
public
MaiaBertogna
(
SystemSetup
systemSetup
)
{
this
.
systemSetup
=
systemSetup
;
super
(
systemSetup
)
;
}
}
@Override
@Override
...
...
src/main/java/mvd/jester/tests/SchmidMottok.java
View file @
19007890
...
@@ -12,10 +12,8 @@ import mvd.jester.model.SystemSetup;
...
@@ -12,10 +12,8 @@ import mvd.jester.model.SystemSetup;
*/
*/
public
class
SchmidMottok
extends
AbstractTest
{
public
class
SchmidMottok
extends
AbstractTest
{
private
final
SystemSetup
systemSetup
;
public
SchmidMottok
(
SystemSetup
systemSetup
)
{
public
SchmidMottok
(
SystemSetup
systemSetup
)
{
this
.
systemSetup
=
systemSetup
;
super
(
systemSetup
)
;
}
}
@Override
@Override
...
...
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