Commit 5d45317d authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

new initialOparationTypes dict attribute added to Job to to be used whenever...

new initialOparationTypes dict attribute added to Job to to be used whenever the job is initialWIP for machine and the operationType for eachstep is defined in its route
parent 11001948
......@@ -37,7 +37,7 @@ class Job(Entity): # inherits from the Entity c
family='Job'
def __init__(self, id=None, name=None, route=[], priority=0, dueDate=0, orderDate=0,
extraPropertyDict=None,remainingProcessingTime={}, remainingSetupTime={}, currentStation=None, isCritical=False,**kw):
extraPropertyDict=None,remainingProcessingTime={}, remainingSetupTime={},currentStation=None, isCritical=False,**kw):
Entity.__init__(self, id=id,name=name, priority=priority, dueDate=dueDate,
remainingProcessingTime=remainingProcessingTime, remainingSetupTime=remainingSetupTime,
currentStation=currentStation, orderDate=orderDate, isCritical=isCritical)
......@@ -56,6 +56,18 @@ class Job(Entity): # inherits from the Entity c
self.alias='J'+str(len(G.JobList))
# added for testing - flag that shows if the order and component routes are defined in the BOM
self.routeInBOM=False
# initialOperationTypes dictionary that shows if there are any manual operations to be performed if the Job is initial WIP at a machine
if self.remainingRoute:
initialSetup=self.remainingRoute[0].get('setupTime',{}) # the setupTime dict of the first step
initialSetupType=0
if initialSetup:
initialSetupType=initialSetup.get('operationType',0)
initialProcessing=self.remainingRoute[0].get('processingTime',{}) # the processingTime dict of the first step
initialProcessingType=0
if initialProcessing:
initialProcessingType=initialProcessing.get('operationType',0)
self.initialOperationTypes={"Setup":initialSetupType,
"Processing":initialProcessingType}
# =======================================================================
# outputs results to JSON File
......
......@@ -250,8 +250,11 @@ class MachineJobShop(Machine):
else:
activeEntity=entity
# read the definition of the time from the remainingRoute dict
if not self.isProcessingInitialWIP:
time=activeEntity.remainingRoute[0].get(str(typeDict[str(type)]),{})
operationType=time.get('operationType', 'not defined')
else: # if the active entity is initialWIP at the start of simulation
operationType=activeEntity.initialOperationTypes.get(str(type),'not defined')
# if the operationType is not 'not defined'
if operationType!='not defined':
# if the operationType key has value 1 (manual operation)
......
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