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):
#===========================================================================
def checkInitialOperationTypes(self):
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
......@@ -679,6 +686,8 @@ class Machine(CoreObject):
else:
# find out if the initialWIP requires manual operations (manual/setup)
self.checkInitialOperationTypes()
# calculate initial processing and setup times
self.calculateInitialOperationTimes()
# TODO: the Machine receive the entity after the operator is available
# the canAcceptAndIsRequested method checks only in case of Load type of operation
......
......@@ -100,22 +100,29 @@ class MachineJobShop(Machine):
def calculateProcessingTime(self):
# this is only for processing of the initial wip
if self.isProcessingInitialWIP:
# read the setup/processing time from the first entry of the full route
activeEntity=self.getActiveObjectQueue()[0]
#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:
processingTime=self.getOperationTime(activeEntity.remainingProcessingTime)
setupTime=self.getOperationTime(activeEntity.remainingSetupTime)
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.procTime=self.rng.generateNumber()
self.stpRng=RandomNumberGenerator(self, setupTime)
return self.procTime #this is the processing time for this unique entity
self.procTime = self.rng.generateNumber()
return self.procTime #this is the processing time for this unique entity
#===========================================================================
# get the initial operation times (setup/processing);
# XXX initialy only setup time is calculated here
#===========================================================================
def calculateInitialOperationTimes(self):
# read the setup/processing time from the first entry of the full route
activeEntity=self.getActiveObjectQueue()[0]
#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:
processingTime=self.getOperationTime(activeEntity.remainingProcessingTime)
setupTime=self.getOperationTime(activeEntity.remainingSetupTime)
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
......
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