Broker code rearranged. Prints added

parent 1acc04cb
......@@ -237,6 +237,7 @@ class Machine(CoreObject):
# if an interruption caused the control to be taken by the machine or
# if an operator was rendered available while it was needed by the machine to proceed with getEntity
if self.interruptionEnd.signalparam==now() or self.loadOperatorAvailable.signalparam==now():
# print now(), self.id, 'received an other type of event sent at ', self.loadOperatorAvailable.signalparam
# try to signal the Giver, otherwise wait until it is requested
if self.signalGiver():
break
......
......@@ -125,6 +125,7 @@ class MachineManagedJob(MachineJobShop):
if activeObject.checkIfActive() and len(activeObjectQueue)<activeObject.capacity\
and activeObject.checkOperator():
if not giverObject.exitIsAssignedTo():
# print self.id, 'assigning givers exit'
giverObject.assignExitTo()
elif giverObject.exitIsAssignedTo()!=activeObject:
return False
......
......@@ -108,6 +108,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
# TODO: has to signal ConditionalBuffer to start sending entities again
for secondary in [x for x in activeEntity.order.secondaryComponentsList if activeEntity.order.basicsEnded]:
if secondary.currentStation.__class__.__name__=='ConditionalBuffer':
# print now(), self.id, ' signalling conditional buffer'
secondary.currentStation.canDispose.signal(now())
break
# for all the components that have the same parent Order as the activeEntity
......
This diff is collapsed.
......@@ -79,6 +79,7 @@ class OrderDecomposition(CoreObject):
self.decompose()
# if the event that activated the thread is canDispose then signalReceiver
if self.haveToDispose():
# print now(), self.id, 'will try to signal a receiver from generator'
self.signalReceiver()
# =======================================================================
......@@ -90,6 +91,7 @@ class OrderDecomposition(CoreObject):
if self.canAccept():
self.signalGiver()
if self.haveToDispose():
# print now(), self.id, 'will try to signal a receiver from removeEntity'
self.signalReceiver()
return activeEntity
......
......@@ -97,14 +97,17 @@ class Queue(CoreObject):
# print now(), self.id, 'just received an event'
# if the event that activated the thread is isRequested then getEntity
if self.isRequested.signalparam:
# print now(), self.id, 'received a isRequested event from', self.isRequested.signalparam.id
# reset the isRequested signal parameter
self.isRequested.signalparam=None
self.getEntity()
#if entity just got to the dummyQ set its startTime as the current time
if self.isDummy:
activeObjectQueue[0].startTime=now()
# if self.canDispose.signalparam:
# print now(), self.id, 'received a canDispose event from', self.canDispose.signalparam.id
# if the queue received an canDispose with signalparam time, this means that the signals was sent from a MouldAssemblyBuffer
if self.canDispose.signalparam:
# print now(), self.id, 'received a canDispose event from', self.canDispose.signalparam
self.canDispose.signalparam=None
# if the event that activated the thread is canDispose then signalReceiver
if self.haveToDispose():
# print now(), self.id, 'will try to signal a receiver from generator'
......
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