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
43791a98
Commit
43791a98
authored
Dec 11, 2016
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conveyer: make sure that canMove event is sent to ConveyerMover only when it should
I.e. only when it is expected by the mover
parent
c1c384a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
dream/simulation/Conveyer.py
dream/simulation/Conveyer.py
+7
-5
No files found.
dream/simulation/Conveyer.py
View file @
43791a98
...
...
@@ -99,11 +99,11 @@ class Conveyer(CoreObject):
while
1
:
#calculate the time to reach end. If this is greater than 0 (we did not already have an entity at the end)
#set it as the timeToWait of the conveyerMover and raise call=true so that it will be triggered
if
self
.
updateMoveTime
()
:
if
self
.
updateMoveTime
()
and
self
.
conveyerMover
.
expectedSignals
[
'canMove'
]:
# print self.id, 'time to move', self.conveyerMover.timeToWait
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
conveyerMover
.
canMove
.
succeed
(
succeedTuple
)
self
.
printTrace
(
self
.
id
,
waitEvent
=
''
)
self
.
expectedSignals
[
'isRequested'
]
=
1
...
...
@@ -369,8 +369,7 @@ class Conveyer(CoreObject):
# self.totalBlockageTime+=self.env.now-self.timeBlockageStarted
self
.
wasFull
=
False
#calculate the time that the conveyer will become available again and trigger the conveyerMover
if
self
.
updateMoveTime
():
# print self.id, 'time to move', self.conveyerMover.timeToWait
if
self
.
updateMoveTime
()
and
self
.
conveyerMover
.
expectedSignals
[
'canMove'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
conveyerMover
.
canMove
.
succeed
(
succeedTuple
)
# if there is anything to dispose of then signal a receiver
...
...
@@ -472,15 +471,18 @@ class ConveyerMover(object):
self
.
timeToWait
=
0
#the time to wait every time. This is calculated by the conveyer and corresponds
#either to the time that one entity reaches the end or the time that one space is freed
self
.
canMove
=
self
.
env
.
event
()
self
.
expectedSignals
=
{
'canMove'
:
1
}
#===========================================================================
# ConveyerMover generator
#===========================================================================
def
run
(
self
):
while
1
:
self
.
conveyer
.
printTrace
(
self
.
conveyer
.
id
,
waitEvent
=
'(canMove)'
)
self
.
expectedSignals
[
'canMove'
]
=
1
yield
self
.
canMove
#wait until the conveyer triggers the mover
transmitter
,
eventTime
=
self
.
canMove
.
value
self
.
expectedSignals
[
'canMove'
]
=
0
self
.
canMove
=
self
.
env
.
event
()
self
.
conveyer
.
printTrace
(
self
.
conveyer
.
id
,
received
=
'(canMove)'
)
...
...
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