def getEntity(self): activeEntity=Queue.getEntity(self) activeEntity.currentStep = activeEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity # update the task_id of the current schedule step dict # find the currentStep within the entity's route if activeEntity.currentStep: try: activeEntity.schedule[-1]["task_id"] = activeEntity.currentStep["task_id"] except KeyError: pass return activeEntity
def getEntity(self): activeEntity = Queue.getEntity(self) activeEntity.currentStep = activeEntity.remainingRoute.pop( 0) #remove data from the remaining route of the entity # update the task_id of the current schedule step dict # find the currentStep within the entity's route if activeEntity.currentStep: try: activeEntity.schedule[-1][ "task_id"] = activeEntity.currentStep["task_id"] except KeyError: pass return activeEntity
def getEntity(self): activeEntity=Queue.getEntity(self) #run the default behavior # update the receiver object of the entity just received according to the routing of the parent batch route = activeEntity.parentBatch.routing() activeEntity.receiver=None try: for nextObj in self.next: if nextObj in activeEntity.parentBatch.routing(): activeEntity.receiver=nextObj break # if none of the siblings (same parentBatch) has gone through the buffer then the receiver should remain None except: pass return activeEntity
def getEntity(self): activeObject = self.getActiveObject() activeEntity=Queue.getEntity(self) # read the possible receivers - update the next list import Globals nextObjectIds=activeEntity.remainingRoute[1].get('stationIdsList',[]) nextObjects = [] for nextObjectId in nextObjectIds: nextObject = Globals.findObjectById(nextObjectId) nextObjects.append(nextObject) # update the next list of the object for nextObject in nextObjects: # append only if not already in the list if nextObject not in activeObject.next: activeObject.next.append(nextObject) # TODO: if the successor of the object is a machine that is operated with operationType 'Load' # then the flag hot of the activeEntity must be set to True # to signalize that the entity has reached its final destination before the next Machine # if the entity is not of type Job if activeEntity.family=='Job': from Globals import G successorsAreMachines=True # for all the objects in the next list for object in nextObjects: # if the object is not in the MachineList # TODO: We must consider also the case that entities can be blocked before they can reach # the heating point. In such a case they must be removed from the G.pendingEntities list # and added again after they are unblocked if not object in G.MachineList: successorsAreMachines=False break # the hot flag should not be raised if successorsAreMachines: activeEntity.hot = True activeEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity return activeEntity
def getEntity(self): activeEntity=Queue.getEntity(self) activeEntity.remainingRoute.pop(0) #remove data from the remaining route of the entity return activeEntity