printTrace comments modified

parent b18fd0e2
......@@ -286,6 +286,7 @@ class Conveyer(CoreObject):
if self.isFull():
self.timeBlockageStarted=now()
self.wasFull=True
self.printTrace(self.id, 'is now Full '+str(len(self.getActiveObjectQueue()))+' (*) '*20)
return activeEntity
#===========================================================================
......
......@@ -326,7 +326,7 @@ class CoreObject(Process):
# signal the successor that the object can dispose an entity
# =======================================================================
def signalReceiver(self):
self.printTrace(self.id, 'trying to signal receiver')
# self.printTrace(self.id, 'trying to signal receiver')
activeObject=self.getActiveObject()
possibleReceivers=activeObject.findReceivers()
if possibleReceivers:
......
......@@ -221,12 +221,12 @@ class Machine(CoreObject):
while 1:
# waitEvent isRequested /interruptionEnd/loadOperatorAvailable
while 1:
# self.printTrace(self.id, 'will wait for event')
self.printTrace(self.id, 'will wait for event')
yield waitevent, self, [self.isRequested, self.interruptionEnd, self.loadOperatorAvailable]
# self.printTrace(self.id, 'received an event')
self.printTrace(self.id, 'received an event')
# if the machine can accept an entity and one predecessor requests it continue with receiving the entity
if self.isRequested.signalparam:
# self.printTrace(self.id, 'received an isRequested event from'+self.isRequested.signalparam.id)
self.printTrace(self.id, 'received an isRequested event from'+self.isRequested.signalparam.id)
assert self.isRequested.signalparam==self.giver, 'the giver is not the requestingObject'
assert self.giver.receiver==self, 'the receiver of the signalling object in not the station'
# reset the signalparam of the isRequested event
......@@ -235,10 +235,10 @@ 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():
# if self.interruptionEnd.signalparam==now():
# self.printTrace(self.id, 'received an interruptionEnd event sent at '+self.interruptionEnd.signalparam)
# elif self.loadOperatorAvailable.signalparam==now():
# self.printTrace(self.id, 'received an loadOperatorAvailable event sent at '+self.loadOperatorAvailable.signalparam)
if self.interruptionEnd.signalparam==now():
self.printTrace(self.id, 'received an interruptionEnd event sent at '+str(self.interruptionEnd.signalparam))
elif self.loadOperatorAvailable.signalparam==now():
self.printTrace(self.id, 'received an loadOperatorAvailable event sent at '+str(self.loadOperatorAvailable.signalparam))
# try to signal the Giver, otherwise wait until it is requested
if self.signalGiver():
break
......@@ -698,7 +698,7 @@ class Machine(CoreObject):
activeObject.waitToDispose=False # update the waitToDispose flag
# if the Machine canAccept then signal a giver
if activeObject.canAccept():
# self.printTrace(self.id, 'will try signalling a giver from removeEntity')
self.printTrace(self.id, 'will try signalling a giver from removeEntity')
activeObject.signalGiver()
return activeEntity
......
......@@ -93,13 +93,13 @@ class Queue(CoreObject):
# check if there is WIP and signal receiver
self.initialSignalReceiver()
while 1:
# self.printTrace(self.id, 'will wait for event')
self.printTrace(self.id, 'will wait for event')
# wait until the Queue can accept an entity and one predecessor requests it
yield waitevent, self, [self.isRequested,self.canDispose, self.loadOperatorAvailable]
# self.printTrace(self.id, 'just received an event')
self.printTrace(self.id, 'just received an event')
# if the event that activated the thread is isRequested then getEntity
if self.isRequested.signalparam:
# self.printTrace(self.id, 'received a isRequested event from'+self.isRequested.signalparam.id)
self.printTrace(self.id, 'received a isRequested event from'+self.isRequested.signalparam.id)
# reset the isRequested signal parameter
self.isRequested.signalparam=None
self.getEntity()
......@@ -112,11 +112,11 @@ class Queue(CoreObject):
self.loadOperatorAvailable.signalparam=None
# if the queue received an canDispose with signalparam time, this means that the signals was sent from a MouldAssemblyBuffer
if self.canDispose.signalparam:
# self.printTrace(self.id, 'received a canDispose event')
self.printTrace(self.id, 'received a canDispose event')
self.canDispose.signalparam=None
# if the event that activated the thread is canDispose then signalReceiver
if self.haveToDispose():
# self.printTrace(self.id, 'will try to signal a receiver from generator')
self.printTrace(self.id, 'will try to signal a receiver from generator')
if self.receiver:
if not self.receiver.entryIsAssignedTo():
self.signalReceiver()
......@@ -169,7 +169,7 @@ class Queue(CoreObject):
# TODO: disable that for the mouldAssemblyBuffer
if not self.__class__.__name__=='MouldAssemblyBuffer':
if self.haveToDispose():
# self.printTrace(self.id, 'will try to signal a receiver from removeEntity')
self.printTrace(self.id, 'will try to signal a receiver from removeEntity')
self.signalReceiver()
return activeEntity
......
......@@ -177,6 +177,7 @@ class Source(CoreObject):
# creates an Entity
#============================================================================
def createEntity(self):
self.printTrace(self.id, 'created an entity')
return self.item(id = self.item.type+str(G.numberOfEntities), name = self.item.type+str(self.numberOfArrivals)) #return the newly created Entity
#============================================================================
# calculates the processing time
......
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