Commit 204fde5c authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

MachineJobShop/ManagedJob updated so that the loadtime is read before the Entity is obtained

parent 87962157
......@@ -57,10 +57,6 @@ class MachineJobShop(Machine):
self.distType=setupTime.get('setupDistribution','Fixed')
self.setupTime=float(setupTime.get('setupMean', 0))
loadTime=activeEntity.remainingRoute[0].get('loadTime',{})
self.distType=loadTime.get('loadDistribution','Fixed')
self.loadTime=float(loadTime.get('loadMean', 0))
import Globals
# read the list of next stations
nextObjectIds=activeEntity.remainingRoute[1].get('stationIdsList',[])
......@@ -190,4 +186,19 @@ class MachineJobShop(Machine):
self.receiver.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station
reactivate(self)
#just extend the default behaviour in order to read the load time from the Entity to be obtained
def canAcceptAndIsRequested(self):
if Machine.canAcceptAndIsRequested(self):
self.readLoadTime()
return True
return False
#to be called by canAcceptAndIsRequested if it is to return True.
#the load timeof the Entity must be read
def readLoadTime(self):
self.giver.sortEntities()
activeEntity=self.giver.getActiveObjectQueue()[0]
loadTime=activeEntity.remainingRoute[0].get('loadTime',{})
self.distType=loadTime.get('loadDistribution','Fixed')
self.loadTime=float(loadTime.get('loadMean', 0))
\ No newline at end of file
......@@ -101,6 +101,7 @@ class MachineManagedJob(MachineJobShop):
#make the operatorsList so that it holds only the manager of the current order
activeObject.operatorPool.operatorsList=[activeObject.giver.getActiveObjectQueue()[0].manager]
activeObject.operatorPool.operators=[activeObject.giver.getActiveObjectQueue()[0].manager]
self.readLoadTime()
return True
else:
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