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
...@@ -310,6 +310,13 @@ class Machine(CoreObject): ...@@ -310,6 +310,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,6 +100,14 @@ class MachineJobShop(Machine): ...@@ -100,6 +100,14 @@ 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:
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 # read the setup/processing time from the first entry of the full route
activeEntity=self.getActiveObjectQueue()[0] activeEntity=self.getActiveObjectQueue()[0]
#if the entity has its route defined in the BOM then remainingProcessing/SetupTime is provided #if the entity has its route defined in the BOM then remainingProcessing/SetupTime is provided
...@@ -113,9 +121,8 @@ class MachineJobShop(Machine): ...@@ -113,9 +121,8 @@ class MachineJobShop(Machine):
setupTime=activeEntity.route[0].get('setupTime',{}) setupTime=activeEntity.route[0].get('setupTime',{})
setupTime=self.getOperationTime(setupTime) setupTime=self.getOperationTime(setupTime)
self.rng=RandomNumberGenerator(self, processingTime) self.rng=RandomNumberGenerator(self, processingTime)
self.procTime=self.rng.generateNumber()
self.stpRng=RandomNumberGenerator(self, setupTime) self.stpRng=RandomNumberGenerator(self, setupTime)
return self.procTime #this is the processing time for this unique entity
# ======================================================================= # =======================================================================
# 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