new method canAcceptEntity added to MachineManagedJob. This method checks...

new method canAcceptEntity added to MachineManagedJob. This method checks whether a machine can receive a specific entity
parent a83ac1c5
...@@ -85,17 +85,23 @@ class MachineManagedJob(MachineJobShop): ...@@ -85,17 +85,23 @@ class MachineManagedJob(MachineJobShop):
#return according to the state of the Queue #return according to the state of the Queue
return len(activeObject.getActiveObjectQueue())<activeObject.capacity\ return len(activeObject.getActiveObjectQueue())<activeObject.capacity\
and activeObject.Up and activeObject.Up
return False
# activeEntities=[]
# for entity in thecaller.getActiveObjectQueue(): # =======================================================================
# if entity.manager.checkIfResourceIsAvailable(self): # checks if the Queue can accept an specific Entity
# activeEntities.append(entity) # it checks also the next station of the Entity
# # and returns true only if the active object is the next station
# if len(activeEntities)>0: # =======================================================================
# for entity in activeEntities: def canAcceptEntity(self, callerEntity=None):
# if activeObject.id in entity.remainingRoute[0].get('stationIdsList',[]): activeObject=self.getActiveObject()
# return len(activeObject.getActiveObjectQueue())<activeObject.capacity\ activeObjectQueue=activeObject.getActiveObjectQueue()
# and activeObject.Up thecallerentity=callerEntity
if (thecallerentity!=None):
# if the machine's Id is in the list of the entity's next stations
if activeObject.id in thecallerentity.remainingRoute[0].get('stationIdsList',[]):
#return according to the state of the Queue
return len(activeObject.getActiveObjectQueue())<activeObject.capacity\
and activeObject.Up
return False return False
# ======================================================================= # =======================================================================
......
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