method activeQueueIsEmpty() added to coreObject to be used as filter for a yield waituntil

parent 37262fc2
......@@ -207,6 +207,8 @@ class CoreObject(Process):
self.receiver.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station
self.outputTrace(activeEntity.name, "got into "+self.objName)
# # TESTING
# print now(), self.id, 'just received', activeEntity.id
return activeEntity
# =======================================================================
......@@ -408,3 +410,11 @@ class CoreObject(Process):
def checkIfActive(self):
return self.Up and self.onShift
#===========================================================================
# filter that returns True if the activeObject Queue is empty and
# false if object holds entities in its queue
#===========================================================================
def activeQueueIsEmpty(self):
# # TESTING
# print now(), self.id, 'has its queue empty?', len(self.Res.activeQ)
return len(self.Res.activeQ)==0
\ No newline at end of file
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