remainingSetupType handled properly on initialWIP; new method added to machine...

remainingSetupType handled properly on initialWIP; new method added to machine that calcultes the processing and setup times on initialWIP condition
parent eac3431b
...@@ -309,6 +309,13 @@ class Machine(CoreObject): ...@@ -309,6 +309,13 @@ class Machine(CoreObject):
#=========================================================================== #===========================================================================
def checkInitialOperationTypes(self): def checkInitialOperationTypes(self):
pass pass
#===========================================================================
# get the initial operation times (setup/processing);
# XXX initialy only setup time is calculated here
#===========================================================================
def calculateInitialOperationTimes(self):
pass
#=========================================================================== #===========================================================================
# method controlling if there is a need to yield # method controlling if there is a need to yield
...@@ -679,6 +686,8 @@ class Machine(CoreObject): ...@@ -679,6 +686,8 @@ class Machine(CoreObject):
else: else:
# find out if the initialWIP requires manual operations (manual/setup) # find out if the initialWIP requires manual operations (manual/setup)
self.checkInitialOperationTypes() self.checkInitialOperationTypes()
# calculate initial processing and setup times
self.calculateInitialOperationTimes()
# TODO: the Machine receive the entity after the operator is available # TODO: the Machine receive the entity after the operator is available
# the canAcceptAndIsRequested method checks only in case of Load type of operation # the canAcceptAndIsRequested method checks only in case of Load type of operation
......
...@@ -100,22 +100,29 @@ class MachineJobShop(Machine): ...@@ -100,22 +100,29 @@ class MachineJobShop(Machine):
def calculateProcessingTime(self): def calculateProcessingTime(self):
# this is only for processing of the initial wip # this is only for processing of the initial wip
if self.isProcessingInitialWIP: if self.isProcessingInitialWIP:
# read the setup/processing time from the first entry of the full route self.procTime = self.rng.generateNumber()
activeEntity=self.getActiveObjectQueue()[0] return self.procTime #this is the processing time for this unique entity
#if the entity has its route defined in the BOM then remainingProcessing/SetupTime is provided
# XX consider moving setupUPtime update to checkForManualOperationTypes as Setup is performed before Processing #===========================================================================
if activeEntity.routeInBOM: # get the initial operation times (setup/processing);
processingTime=self.getOperationTime(activeEntity.remainingProcessingTime) # XXX initialy only setup time is calculated here
setupTime=self.getOperationTime(activeEntity.remainingSetupTime) #===========================================================================
else: # other wise these should be read from the route def calculateInitialOperationTimes(self):
processingTime=activeEntity.route[0].get('processingTime',{}) # read the setup/processing time from the first entry of the full route
processingTime=self.getOperationTime(processingTime) activeEntity=self.getActiveObjectQueue()[0]
setupTime=activeEntity.route[0].get('setupTime',{}) #if the entity has its route defined in the BOM then remainingProcessing/SetupTime is provided
setupTime=self.getOperationTime(setupTime) # XX consider moving setupUPtime update to checkForManualOperationTypes as Setup is performed before Processing
self.rng=RandomNumberGenerator(self, processingTime) if activeEntity.routeInBOM:
self.procTime=self.rng.generateNumber() processingTime=self.getOperationTime(activeEntity.remainingProcessingTime)
self.stpRng=RandomNumberGenerator(self, setupTime) setupTime=self.getOperationTime(activeEntity.remainingSetupTime)
return self.procTime #this is the processing time for this unique entity else: # other wise these should be read from the route
processingTime=activeEntity.route[0].get('processingTime',{})
processingTime=self.getOperationTime(processingTime)
setupTime=activeEntity.route[0].get('setupTime',{})
setupTime=self.getOperationTime(setupTime)
self.rng=RandomNumberGenerator(self, processingTime)
self.stpRng=RandomNumberGenerator(self, setupTime)
# ======================================================================= # =======================================================================
# checks if the Queue can accept an entity # checks if the Queue can accept an entity
......
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