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
...@@ -56,10 +56,6 @@ class MachineJobShop(Machine): ...@@ -56,10 +56,6 @@ class MachineJobShop(Machine):
setupTime=activeEntity.remainingRoute[0].get('setupTime',{}) setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
self.distType=setupTime.get('setupDistribution','Fixed') self.distType=setupTime.get('setupDistribution','Fixed')
self.setupTime=float(setupTime.get('setupMean', 0)) 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 import Globals
# read the list of next stations # read the list of next stations
...@@ -190,4 +186,19 @@ class MachineJobShop(Machine): ...@@ -190,4 +186,19 @@ class MachineJobShop(Machine):
self.receiver.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station self.receiver.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station
reactivate(self) 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): ...@@ -101,6 +101,7 @@ class MachineManagedJob(MachineJobShop):
#make the operatorsList so that it holds only the manager of the current order #make the operatorsList so that it holds only the manager of the current order
activeObject.operatorPool.operatorsList=[activeObject.giver.getActiveObjectQueue()[0].manager] activeObject.operatorPool.operatorsList=[activeObject.giver.getActiveObjectQueue()[0].manager]
activeObject.operatorPool.operators=[activeObject.giver.getActiveObjectQueue()[0].manager] activeObject.operatorPool.operators=[activeObject.giver.getActiveObjectQueue()[0].manager]
self.readLoadTime()
return True return True
else: else:
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