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
5e5158f9
Commit
5e5158f9
authored
Sep 09, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CapacityStationController also updated
parent
85a340ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+18
-4
No files found.
dream/simulation/CapacityStationController.py
View file @
5e5158f9
...
...
@@ -62,11 +62,18 @@ class CapacityStationController(EventGenerator):
entitiesToCheck
=
list
(
station
.
getActiveObjectQueue
())
for
entity
in
entitiesToCheck
:
if
not
exit
.
isRequested
.
triggered
:
# this is needed because the signal can be triggered also by the buffer
if
exit
.
expectedSignals
[
'isRequested'
]:
succeedTuple
=
(
station
,
self
.
env
.
now
)
exit
.
isRequested
.
succeed
(
succeedTuple
)
# send is requested to station
# wait until the entity is removed
station
.
waitEntityRemoval
=
True
station
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
station
.
entityRemoved
station
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
station
.
entityRemoved
.
value
station
.
waitEntityRemoval
=
False
exit
.
currentlyObtainedEntities
.
append
(
entity
)
...
...
@@ -115,11 +122,18 @@ class CapacityStationController(EventGenerator):
for
entity
in
entitiesToCheck
:
if
not
entity
.
shouldMove
:
# when the first entity that should not move is reached break
break
if
station
.
expectedSignals
[
'isRequested'
]:
succeedTuple
=
(
buffer
,
self
.
env
.
now
)
station
.
isRequested
.
succeed
(
succeedTuple
)
# send is requested to station
# wait until the entity is removed
buffer
.
waitEntityRemoval
=
True
buffer
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
buffer
.
entityRemoved
buffer
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
buffer
.
entityRemoved
.
value
buffer
.
waitEntityRemoval
=
False
buffer
.
entityRemoved
=
self
.
env
.
event
()
...
...
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