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
0fa26904
Commit
0fa26904
authored
Jan 15, 2014
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activeQSorter method modified to incoporate the sorting criterion of ConditionalBuffer object
parent
71602134
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
dream/simulation/Queue.py
dream/simulation/Queue.py
+9
-4
No files found.
dream/simulation/Queue.py
View file @
0fa26904
...
...
@@ -209,9 +209,6 @@ class Queue(CoreObject):
# =======================================================================
# sorts the Entities of the Queue according to the scheduling rule
# =======================================================================
# =======================================================================
# sorts the Entities of the Queue according to the scheduling rule
# =======================================================================
def
activeQSorter
(
self
,
criterion
=
None
):
activeObjectQ
=
self
.
Res
.
activeQ
if
criterion
==
None
:
...
...
@@ -279,4 +276,12 @@ class Queue(CoreObject):
if
obj
.
id
in
nextObjIds
:
nextObject
=
obj
entity
.
nextQueueLength
=
len
(
nextObject
.
getActiveObjectQueue
())
activeObjectQ
.
sort
(
key
=
lambda
x
:
x
.
nextQueueLength
)
\ No newline at end of file
activeObjectQ
.
sort
(
key
=
lambda
x
:
x
.
nextQueueLength
)
#if the schedulingRule is set to ConditionalBuffer scheduling rule "CB" where orderComponents of type "Secondary"
#are moved to the end of the queue if their parent order.basicsEnded property is set to False
elif
criterion
==
'CB'
:
# if the componentType is Basic then don't move it to the end of the activeQ
# else if the componentType is Secondary and it's basics are not ended then move it to the back
activeObjectQ
.
sort
(
key
=
lambda
x
:
not
((
x
.
componentType
==
'Basic'
)
\
or
((
x
.
order
.
basicsEnded
)
\
and
(
x
.
componentType
==
'Secondary'
))))
\ No newline at end of file
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