def removeEntity(self, entity=None): # if it is the first sub-batch of the parent batch that leaves # assign it as the batch start time if len(self.getActiveObjectQueue())==self.numberOfSubBatches: batch=self.getActiveObjectQueue()[0].parentBatch batch.startTime=now() activeEntity=BatchDecomposition.removeEntity(self, entity) return activeEntity
def removeEntity(self, entity=None): # if it is the first sub-batch of the parent batch that leaves # assign it as the batch start time if len(self.getActiveObjectQueue()) == self.numberOfSubBatches: batch = self.getActiveObjectQueue()[0].parentBatch batch.startTime = self.env.now activeEntity = BatchDecomposition.removeEntity(self, entity) return activeEntity
def canAcceptAndIsRequested(self, callerObject=None): station=self from Queue import Queue from Exit import Exit # loop to next stations until a Queue or Exit is reached while 1: next=station.next[0] # if a Queue or Exit is reached break if issubclass(next.__class__, Queue) or issubclass(next.__class__, Exit): break # if the object is not free return False if len(next.getActiveObjectQueue()): return False station=next # return according to parent return BatchDecomposition.canAcceptAndIsRequested(self, callerObject)