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
ece1123a
Commit
ece1123a
authored
Feb 11, 2014
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Feb 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments clean-up in QueueManagedJob
parent
a2d479bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
dream/simulation/QueueManagedJob.py
dream/simulation/QueueManagedJob.py
+4
-7
No files found.
dream/simulation/QueueManagedJob.py
View file @
ece1123a
...
...
@@ -50,7 +50,6 @@ class QueueManagedJob(QueueJobShop):
if
entity
.
manager
.
checkIfResourceIsAvailable
:
haveEntityWithAvailableManager
=
True
#if none of the Entities has an available manager return False
if
not
haveEntityWithAvailableManager
:
return
False
...
...
@@ -67,14 +66,12 @@ class QueueManagedJob(QueueJobShop):
#give the entity to the possible receiver that is waiting for the most time.
maxTimeWaiting
=
0
# loop through the object in the successor list
for
object
in
activeObject
.
next
:
for
object
in
activeObject
.
next
:
# loop through the object in the successor list
if
(
object
.
canAccept
(
activeObject
)):
# if the object can accept
timeWaiting
=
now
()
-
object
.
timeLastEntityLeft
# compare the time that it has been waiting
if
(
timeWaiting
>
maxTimeWaiting
or
maxTimeWaiting
==
0
):
# with the others'
maxTimeWaiting
=
timeWaiting
self
.
receiver
=
object
# and update the receiver to the index of this object
self
.
receiver
=
object
# and update the receiver
#return True if the Queue has Entities and the caller is the receiver
return
len
(
activeObjectQueue
)
>
0
and
(
thecaller
is
self
.
receiver
)
...
...
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