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
ee8accc8
Commit
ee8accc8
authored
Jan 20, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise an error when attempting to use an invalid scheduling rule on a queue
parent
3b4c70dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
dream/simulation/Queue.py
dream/simulation/Queue.py
+11
-1
No files found.
dream/simulation/Queue.py
View file @
ee8accc8
...
...
@@ -64,11 +64,18 @@ class Queue(CoreObject):
self
.
isDummy
=
dummy
#Boolean that shows if it is the dummy first Queue
self
.
schedulingRule
=
schedulingRule
#the scheduling rule that the Queue follows
self
.
multipleCriterionList
=
[]
#list with the criteria used to sort the Entities in the Queue
SRlist
=
[
schedulingRule
]
if
schedulingRule
.
startswith
(
"MC"
):
# if the first criterion is MC aka multiple criteria
SRlist
=
schedulingRule
.
split
(
"-"
)
# split the string of the criteria (delimiter -)
self
.
schedulingRule
=
SRlist
.
pop
(
0
)
# take the first criterion of the list
self
.
multipleCriterionList
=
SRlist
# hold the criteria list in the property multipleCriterionList
for
scheduling_rule
in
SRlist
:
if
scheduling_rule
not
in
(
"FIFO"
,
"Priority"
,
"EDD"
,
"EOD"
,
"NumStages"
,
"RPC"
,
"LPT"
,
"SPT"
,
"MS"
,
"WINQ"
):
raise
ValueError
(
"Unknown scheduling rule %s for %s"
%
(
scheduling_rule
,
id
))
def
initialize
(
self
):
# using the Process __init__ and not the CoreObject __init__
CoreObject
.
initialize
(
self
)
...
...
@@ -291,3 +298,6 @@ class Queue(CoreObject):
elif
criterion
==
'MAB'
:
# if all the components of the same mould are present then move them to the front of the activeQ
activeObjectQ
.
sort
(
key
=
lambda
x
:
x
.
order
.
componentsReadyForAssembly
)
else
:
assert
False
,
"Unknown scheduling criterion %r"
%
(
criterion
,
)
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