Commit 4707cf09 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

canAccept of Machine clean-up

parent 89dcc987
...@@ -966,21 +966,11 @@ class Machine(CoreObject): ...@@ -966,21 +966,11 @@ class Machine(CoreObject):
if self.isLocked: if self.isLocked:
return False return False
activeObjectQueue=self.Res.users activeObjectQueue=self.Res.users
# if we have only one predecessor just check if there is a place and the machine is up # local flag that is set only if there is no callerObject or if thecaller is predecessor of the activeObject
# this is done to achieve better (cpu) processing time theCallerIsPredecessor=False
# then we can also use it as a filter for a yield method
if(callerObject==None):
if (self.operatorPool!='None' and (any(type=='Load' for type in self.multOperationTypeList)\
or any(type=='Setup' for type in self.multOperationTypeList))):
return self.operatorPool.checkIfResourceIsAvailable()\
and self.checkIfMachineIsUp()\
and len(activeObjectQueue)<self.capacity\
and not self.entryIsAssignedTo()
else:
return self.checkIfMachineIsUp()\
and len(activeObjectQueue)<self.capacity\
and not self.entryIsAssignedTo()
thecaller=callerObject thecaller=callerObject
if callerObject==None or thecaller in self.previous:
theCallerIsPredecessor=True
# return True ONLY if the length of the activeOjbectQue is smaller than # return True ONLY if the length of the activeOjbectQue is smaller than
# the object capacity, and the callerObject is not None but the giverObject # the object capacity, and the callerObject is not None but the giverObject
if (self.operatorPool!='None' and (any(type=='Load' for type in self.multOperationTypeList)\ if (self.operatorPool!='None' and (any(type=='Load' for type in self.multOperationTypeList)\
...@@ -988,13 +978,14 @@ class Machine(CoreObject): ...@@ -988,13 +978,14 @@ class Machine(CoreObject):
return self.operatorPool.checkIfResourceIsAvailable()\ return self.operatorPool.checkIfResourceIsAvailable()\
and self.checkIfMachineIsUp()\ and self.checkIfMachineIsUp()\
and len(activeObjectQueue)<self.capacity\ and len(activeObjectQueue)<self.capacity\
and theCallerIsPredecessor\
and not self.entryIsAssignedTo() and not self.entryIsAssignedTo()
else: else:
# the operator doesn't have to be present for the loading of the machine as the load operation # the operator doesn't have to be present for the loading of the machine as the load operation
# is not assigned to operators # is not assigned to operators
return self.checkIfMachineIsUp()\ return self.checkIfMachineIsUp()\
and len(activeObjectQueue)<self.capacity\ and len(activeObjectQueue)<self.capacity\
and (thecaller in self.previous)\ and theCallerIsPredecessor\
and not self.entryIsAssignedTo() and not self.entryIsAssignedTo()
# ======================================================================= # =======================================================================
......
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