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
2f8c1f6c
Commit
2f8c1f6c
authored
Feb 21, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QueueJobShop enhancement so that it only returns true if a receiver canAccept
parent
4bc30e23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
dream/simulation/QueueJobShop.py
dream/simulation/QueueJobShop.py
+5
-5
No files found.
dream/simulation/QueueJobShop.py
View file @
2f8c1f6c
...
...
@@ -68,8 +68,7 @@ class QueueJobShop(Queue):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
thecaller
=
callerObject
#if we have only one possible receiver just check if the Queue holds one or more entities
if
(
len
(
activeObject
.
next
)
==
1
or
callerObject
==
None
):
activeObject
.
receiver
=
activeObject
.
next
[
0
]
...
...
@@ -80,20 +79,22 @@ class QueueJobShop(Queue):
#plant does not do this in every occasion!
maxTimeWaiting
=
0
# loop through the object in the successor list
hasFreeReceiver
=
False
for
object
in
activeObject
.
next
:
if
(
object
.
canAccept
(
activeObject
)):
# if the object can accept
hasFreeReceiver
=
True
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
#return True if the Queue has Entities and the caller is the receiver
return
len
(
activeObjectQueue
)
>
0
and
(
thecaller
is
self
.
receiver
)
return
len
(
activeObjectQueue
)
>
0
and
(
thecaller
is
self
.
receiver
)
and
hasFreeReceiver
# =======================================================================
# gets an entity from the predecessor that the predecessor index points to
# =======================================================================
def
getEntity
(
self
):
def
getEntity
(
self
):
activeObject
=
self
.
getActiveObject
()
activeEntity
=
Queue
.
getEntity
(
self
)
# read the possible receivers - update the next list
...
...
@@ -104,7 +105,6 @@ class QueueJobShop(Queue):
nextObject
=
Globals
.
findObjectById
(
nextObjectId
)
nextObjects
.
append
(
nextObject
)
activeObject
.
next
=
nextObjects
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
\ 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