Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
simso
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
2cc8723e
authored
May 04, 2015
by
Maxime Chéramy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BF scheduler: remove sympy dependency (use Fraction instead).
parent
287d0068
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
schedulers/BF.py
+8
-8
No files found.
schedulers/BF.py
View file @
2cc8723e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
Implementation of the BF algorithm.
Implementation of the BF algorithm.
"""
"""
from
simso.core
import
Scheduler
,
Timer
from
simso.core
import
Scheduler
,
Timer
import
sympy
from
fractions
import
Fraction
class
BF
(
Scheduler
):
class
BF
(
Scheduler
):
...
@@ -95,17 +95,17 @@ class BF(Scheduler):
...
@@ -95,17 +95,17 @@ class BF(Scheduler):
continue
continue
rw
=
self
.
rw
[
task
.
identifier
]
rw
=
self
.
rw
[
task
.
identifier
]
m_pure
=
(
rw
+
((
w
*
task
.
job
.
wcet
)
/
m_pure
=
(
(
Fraction
(
rw
)
+
Fraction
(
w
*
task
.
job
.
wcet
)
task
.
job
.
period
))
/
self
.
sim
.
cycles_per_ms
/
Fraction
(
task
.
job
.
period
))
m_pure
=
sympy
.
nsimplify
(
m_pure
)
/
Fraction
(
self
.
sim
.
cycles_per_ms
)
)
m
=
int
(
m_pure
)
m
=
int
(
m_pure
)
self
.
pw
[
task
.
identifier
]
=
m_pure
-
m
self
.
pw
[
task
.
identifier
]
=
m_pure
-
m
mand
[
task
.
identifier
]
=
max
(
0
,
m
*
self
.
sim
.
cycles_per_ms
)
mand
[
task
.
identifier
]
=
max
(
0
,
m
*
self
.
sim
.
cycles_per_ms
)
print
(
"rw: {:>4}"
.
format
(
rw
))
#
print("rw: {:>4}".format(rw))
print
(
"{}:, w: {}, m_pure: {:>4}, m: {:>2}, pw: {:>4}, mand: {}"
.
format
(
#
print("{}:, w: {}, m_pure: {:>4}, m: {:>2}, pw: {:>4}, mand: {}".format(
task
.
name
,
w
/
self
.
sim
.
cycles_per_ms
,
m_pure
,
m
,
#
task.name, w/self.sim.cycles_per_ms, m_pure, m,
self
.
pw
[
task
.
identifier
],
mand
[
task
.
identifier
]))
#
self.pw[task.identifier], mand[task.identifier]))
available
-=
mand
[
task
.
identifier
]
available
-=
mand
[
task
.
identifier
]
if
mand
[
task
.
identifier
]
<
w
and
self
.
pw
[
task
.
identifier
]
>
0
:
if
mand
[
task
.
identifier
]
<
w
and
self
.
pw
[
task
.
identifier
]
>
0
:
...
...
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