Commit 775857e5 authored by Georgios Dagkakis's avatar Georgios Dagkakis

wait for elements to move before deciding if buffer has space

parent 32ae236e
......@@ -17,7 +17,7 @@ f=0.2
maxSimTime=1000
# the capacity of B123
capacity=45 # float('inf')
capacity=3 # float('inf')
class OpQueue(Queue):
# allow to be locked between the time periods
......@@ -115,6 +115,7 @@ def controllerMethod():
E.locked=False
if len(M3.getActiveObjectQueue()) and (not M3.state==0):
Controller.sendSignal(sender=M3, receiver=E,signal=E.isRequested)
while len(M3.getActiveObjectQueue()):
yield G.env.timeout(0)
E.locked=True
......@@ -122,6 +123,7 @@ def controllerMethod():
M3.locked=False
if len(B123.getActiveObjectQueue()) and (not M3.state==0):
Controller.sendSignal(sender=B123, receiver=M3,signal=M3.isRequested)
while not len(M3.getActiveObjectQueue()):
yield G.env.timeout(0)
M3.locked=True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment