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(): # checks if the Queue can accept an specific Entity
# if entity.manager.checkIfResourceIsAvailable(self): # it checks also the next station of the Entity
# activeEntities.append(entity) # and returns true only if the active object is the next station
# # =======================================================================
# if len(activeEntities)>0: def canAcceptEntity(self, callerEntity=None):
# for entity in activeEntities: activeObject=self.getActiveObject()
# if activeObject.id in entity.remainingRoute[0].get('stationIdsList',[]): activeObjectQueue=activeObject.getActiveObjectQueue()
# return len(activeObject.getActiveObjectQueue())<activeObject.capacity\ thecallerentity=callerEntity
# and activeObject.Up 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