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
3de79738
Commit
3de79738
authored
Mar 05, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new sorting method added to QueueManagedJob
parent
76c7e674
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
dream/simulation/QueueManagedJob.py
dream/simulation/QueueManagedJob.py
+18
-1
No files found.
dream/simulation/QueueManagedJob.py
View file @
3de79738
...
...
@@ -108,4 +108,21 @@ class QueueManagedJob(QueueJobShop):
# sort the active queue according to the availability of the managers
activeObjectQueue
.
sort
(
key
=
lambda
x
:
x
.
managerAvailable
,
reverse
=
True
)
\ No newline at end of file
# =======================================================================
# sorting will take into account the manager calling the method
# the entities which have the same manager with the operator
# will be in front of the queue
# if the entity in front of the queue has no manager available
# then the sorting is unsuccessful
# =======================================================================
def
sortEntitiesForOperator
(
self
,
operator
=
None
):
activeObjectQueue
=
self
.
getActiveObjectQueue
()
if
operator
:
self
.
sortEntities
()
activeObjectQueue
.
sort
(
key
=
lambda
x
:
x
.
manager
==
operator
,
reverse
=
True
)
if
not
activeObjectQueue
[
0
].
managerAvailable
:
# added for testing
print
'the entity in front of the internal queue has no manager available, revise'
else
:
# added for testing
print
'there must be a caller defined for this kind of Queue sorting'
\ 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