コード例 #1
0
ファイル: MachineJobShop.py プロジェクト: PanosBarlas/dream
 def getEntity(self):
     activeObject=self.getActiveObject()
     activeEntity=Machine.getEntity(self)     #run the default code
     # read the processing time from the corresponding remainingRoute entry
     processingTime=activeEntity.remainingRoute[0].get('processingTime',{})
     processingTime=self.getOperationTime(processingTime)
     self.rng=RandomNumberGenerator(self, processingTime)
     self.procTime=self.rng.generateNumber()
     # check if there is a need for manual processing
     self.checkForManualOperation(type='Processing',entity=activeEntity)
     # read the setup time from the corresponding remainingRoute entry
     setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
     setupTime=self.getOperationTime(setupTime)
     self.stpRng=RandomNumberGenerator(self, setupTime)
     # check if there is a need for manual processing
     self.checkForManualOperation(type='Setup',entity=activeEntity)
     activeEntity.currentStep = activeEntity.remainingRoute.pop(0)      #remove data from the remaining route of the entity
     if activeEntity.currentStep:
         # update the task_id of the currentStep dict within the schedule
         try:
             activeEntity.schedule[-1]["task_id"] = activeEntity.currentStep["task_id"]
             # if there is currentOperator then update the taskId of corresponding step of their schedule according to the task_id of the currentStep
             if self.currentOperator:
                 self.currentOperator.schedule[-1]["task_id"] = activeEntity.currentStep["task_id"]
         except KeyError:
             pass
     return activeEntity
コード例 #2
0
ファイル: MachineJobShop.py プロジェクト: mmariani/dream
 def getEntity(self):
     activeObject=self.getActiveObject()
     activeEntity=Machine.getEntity(self)     #run the default code
     
     # read the processing/setup/load times from the corresponding remainingRoute entry
     processingTime=activeEntity.remainingRoute[0].get('processingTime',{})
     self.distType=processingTime.get('distributionType','Fixed')
     self.procTime=float(processingTime.get('mean', 0))
     
     setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
     self.distType=setupTime.get('distributionType','Fixed')
     self.setupTime=float(setupTime.get('mean', 0))
     
     import Globals
     # read the list of next stations
     nextObjectIds=activeEntity.remainingRoute[1].get('stationIdsList',[])
     nextObjects = []
     for nextObjectId in nextObjectIds:
         nextObject=Globals.findObjectById(nextObjectId)
         nextObjects.append(nextObject)
     # update the next list of the object
     for nextObject in nextObjects:
         # append only if not already in the list
         if nextObject not in activeObject.next:
             activeObject.next.append(nextObject)
     removedStep = activeEntity.remainingRoute.pop(0)      #remove data from the remaining route of the entity
     return activeEntity  
コード例 #3
0
 def getEntity(self):
     activeObject = self.getActiveObject()
     activeEntity = Machine.getEntity(self)  #run the default code
     # read the processing time from the corresponding remainingRoute entry
     processingTime = activeEntity.remainingRoute[0].get(
         'processingTime', {})
     processingTime = self.getOperationTime(processingTime)
     self.rng = RandomNumberGenerator(self, processingTime)
     self.procTime = self.rng.generateNumber()
     # check if there is a need for manual processing
     self.checkForManualOperation(type='Processing', entity=activeEntity)
     # read the setup time from the corresponding remainingRoute entry
     setupTime = activeEntity.remainingRoute[0].get('setupTime', {})
     setupTime = self.getOperationTime(setupTime)
     self.stpRng = RandomNumberGenerator(self, setupTime)
     # check if there is a need for manual processing
     self.checkForManualOperation(type='Setup', entity=activeEntity)
     activeEntity.currentStep = activeEntity.remainingRoute.pop(
         0)  #remove data from the remaining route of the entity
     if activeEntity.currentStep:
         # update the task_id of the currentStep dict within the schedule
         try:
             activeEntity.schedule[-1][
                 "task_id"] = activeEntity.currentStep["task_id"]
             # if there is currentOperator then update the taskId of corresponding step of their schedule according to the task_id of the currentStep
             if self.currentOperator:
                 self.currentOperator.schedule[-1][
                     "task_id"] = activeEntity.currentStep["task_id"]
         except KeyError:
             pass
     return activeEntity
コード例 #4
0
ファイル: MachineJobShop.py プロジェクト: cpcdevelop/dream
 def getEntity(self):
     activeObject=self.getActiveObject()
     activeEntity=Machine.getEntity(self)     #run the default code
     
     # read the processing/setup/load times from the corresponding remainingRoute entry
     processingTime=activeEntity.remainingRoute[0].get('processingTime',{})
     self.distType=processingTime.get('distributionType','Fixed')
     self.procTime=float(processingTime.get('mean', 0))
     
     setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
     self.distType=setupTime.get('distributionType','Fixed')
     self.setupTime=float(setupTime.get('mean', 0))
     removedStep = activeEntity.remainingRoute.pop(0)      #remove data from the remaining route of the entity
     return activeEntity
コード例 #5
0
ファイル: MachineJobShop.py プロジェクト: Kodextor/dream
 def getEntity(self):
     activeObject=self.getActiveObject()
     activeEntity=Machine.getEntity(self)     #run the default code
     
     # read the processing/setup/load times from the corresponding remainingRoute entry
     processingTime=activeEntity.remainingRoute[0].get('processingTime',{})
     processingTime=self.getProcessingTime(processingTime)
     self.rng=RandomNumberGenerator(self, **processingTime)
     self.procTime=self.rng.generateNumber()
     
     setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
     setupTime=self.getSetupTime(setupTime)
     self.stpRng=RandomNumberGenerator(self, **setupTime)
     
     removedStep = activeEntity.remainingRoute.pop(0)      #remove data from the remaining route of the entity
     return activeEntity
コード例 #6
0
 def getEntity(self):
     activeObject=self.getActiveObject()
     activeEntity=Machine.getEntity(self)     #run the default code
     # read the processing time from the corresponding remainingRoute entry
     processingTime=activeEntity.remainingRoute[0].get('processingTime',{})
     processingTime=self.getOperationTime(processingTime)
     self.rng=RandomNumberGenerator(self, processingTime)
     self.procTime=self.rng.generateNumber()
     # check if there is a need for manual processing
     self.checkForManualOperation(type='Processing',entity=activeEntity)
     # read the setup time from the corresponding remainingRoute entry
     setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
     setupTime=self.getOperationTime(setupTime)
     self.stpRng=RandomNumberGenerator(self, setupTime)
     # check if there is a need for manual processing
     self.checkForManualOperation(type='Setup',entity=activeEntity)
     removedStep = activeEntity.remainingRoute.pop(0)      #remove data from the remaining route of the entity
     return activeEntity