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
47e6e215
Commit
47e6e215
authored
Feb 05, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QueueManagedJob sortEntities added so that the Entities for which the manager is available go first
parent
16c0767d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
dream/simulation/QueueManagedJob.py
dream/simulation/QueueManagedJob.py
+13
-2
No files found.
dream/simulation/QueueManagedJob.py
View file @
47e6e215
...
...
@@ -61,6 +61,7 @@ class QueueManagedJob(QueueJobShop):
if
(
len
(
activeObject
.
next
)
==
1
or
callerObject
==
None
):
activeObject
.
receiver
=
activeObject
.
next
[
0
]
return
len
(
activeObjectQueue
)
>
0
\
and
thecaller
==
activeObject
.
receiver
...
...
@@ -77,5 +78,15 @@ class QueueManagedJob(QueueJobShop):
#return True if the Queue has Entities and the caller is the receiver
return
len
(
activeObjectQueue
)
>
0
and
(
thecaller
is
self
.
receiver
)
#override the default method so that Entities that have the manager available go in front
def
sortEntities
(
self
):
QueueJobShop
.
sortEntities
(
self
)
#do the default sorting first
activeObjectQueue
=
self
.
getActiveObjectQueue
()
for
entity
in
activeObjectQueue
:
entity
.
managerAvailable
=
False
if
entity
.
manager
:
if
entity
.
manager
.
checkIfResourceIsAvailable
:
entity
.
managerAvailable
=
True
activeObjectQueue
.
sort
(
key
=
lambda
x
:
x
.
managerAvailable
,
reverse
=
True
)
\ 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