Commit ccf38908 authored by Georgios Dagkakis's avatar Georgios Dagkakis

example does not have to send signal now

parent 15a9b727
...@@ -8,6 +8,7 @@ def balanceQueue(buffer, refillLevel=1): ...@@ -8,6 +8,7 @@ def balanceQueue(buffer, refillLevel=1):
numInQueue=len(objectQueue) numInQueue=len(objectQueue)
print '-'*50 print '-'*50
print 'at time=', G.env.now print 'at time=', G.env.now
# check if the buffer is empty and if yes fill it with 5 parts
if numInQueue==0: if numInQueue==0:
print 'buffer is starving, I will bring 5 parts' print 'buffer is starving, I will bring 5 parts'
for i in range(refillLevel): for i in range(refillLevel):
...@@ -19,8 +20,7 @@ def balanceQueue(buffer, refillLevel=1): ...@@ -19,8 +20,7 @@ def balanceQueue(buffer, refillLevel=1):
# set the part as WIP # set the part as WIP
setWIP([P]) setWIP([P])
G.numOfParts+=1 G.numOfParts+=1
# send a signal to the buffer that it can dispose an Entity # else do nothing
buffer.canDispose.succeed(G.env.now)
else: else:
print 'buffer has', numInQueue, 'parts. No need to bring more' print 'buffer has', numInQueue, 'parts. No need to bring more'
......
...@@ -280,7 +280,6 @@ def setWIP(entityList): ...@@ -280,7 +280,6 @@ def setWIP(entityList):
if issubclass(entity.currentStation.__class__, Queue): if issubclass(entity.currentStation.__class__, Queue):
# send the signal only if it is not already triggered # send the signal only if it is not already triggered
if not entity.currentStation.canDispose.triggered: if not entity.currentStation.canDispose.triggered:
# print 'sending canDispose to', entity.currentStation.id
entity.currentStation.canDispose.succeed(G.env.now) entity.currentStation.canDispose.succeed(G.env.now)
# if we are in the start of the simulation the object is of server type then we should send initialWIP signal # if we are in the start of the simulation the object is of server type then we should send initialWIP signal
# TODO, maybe use 'class_family attribute here' # TODO, maybe use 'class_family attribute here'
......
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