Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
0f7759bd
Commit
0f7759bd
authored
Sep 19, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activeQsorter of operator correction
parent
400ce688
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
dream/simulation/Operator.py
dream/simulation/Operator.py
+8
-13
No files found.
dream/simulation/Operator.py
View file @
0f7759bd
...
...
@@ -152,16 +152,6 @@ class Operator(ObjectResource):
machine
.
timeWaiting
=
self
.
env
.
now
-
machine
.
broker
.
timeWaitForOperatorStarted
else
:
machine
.
timeWaiting
=
self
.
env
.
now
-
machine
.
timeLastEntityLeft
# find the stations that hold or are about to be delivered critical entities
if
self
in
router
.
preemptiveOperators
:
for
entity
in
machine
.
getActiveObjectQueue
():
if
entity
in
router
.
pending
and
entity
.
isCritical
:
machine
.
critical
=
True
break
for
previous
in
machine
.
previous
:
for
entity
in
previous
.
getActiveObjectQueue
():
if
entity
in
router
.
pending
and
entity
.
isCritical
:
machine
.
critical
=
True
# sort the stations according their timeWaiting
self
.
candidateStations
.
sort
(
key
=
lambda
x
:
x
.
timeWaiting
,
reverse
=
True
)
...
...
@@ -175,7 +165,6 @@ class Operator(ObjectResource):
self
.
activeQSorter
(
criterion
=
criterion
)
#else we just use the default scheduling rule
else
:
print
self
.
schedulingRule
self
.
activeQSorter
(
self
.
schedulingRule
)
# =======================================================================
...
...
@@ -216,12 +205,13 @@ class Operator(ObjectResource):
# =======================================================================
def
activeQSorter
(
self
,
criterion
=
None
):
activeObjectQ
=
self
.
candidateEntities
if
criterion
==
None
:
criterion
=
self
.
schedulingRule
#if the schedulingRule is first in first out
if
criterion
==
"FIFO"
:
# FIFO sorting has no meaning when sorting candidateEntities
self
.
active
Candidate
QSorter
(
'WT'
)
self
.
activeQSorter
(
'WT'
)
#if the schedulingRule is based on a pre-defined priority
elif
criterion
==
"Priority"
:
...
...
@@ -229,7 +219,12 @@ class Operator(ObjectResource):
#if the scheduling rule is time waiting (time waiting of machine)
elif
criterion
==
'WT'
:
activeObjectQ
.
sort
(
key
=
lambda
x
:
x
.
schedule
[
-
1
][
1
])
for
part
in
activeObjectQ
:
part
.
factor
=
0
if
part
.
schedule
:
part
.
factor
=
self
.
env
.
now
-
part
.
schedule
[
-
1
][
1
]
activeObjectQ
.
sort
(
key
=
lambda
x
:
x
.
factor
,
reverse
=
True
)
#if the schedulingRule is earliest due date
elif
criterion
==
"EDD"
:
...
...
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