Commit d99462ff authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

LineGenerationJSON.py updated so that it can read also BatchScrapMachineObjects

parent 292b94e1
...@@ -75,6 +75,7 @@ from SubBatch import SubBatch ...@@ -75,6 +75,7 @@ from SubBatch import SubBatch
from BatchSource import BatchSource from BatchSource import BatchSource
from BatchDecomposition import BatchDecomposition from BatchDecomposition import BatchDecomposition
from BatchReassembly import BatchReassembly from BatchReassembly import BatchReassembly
from BatchScrapMachine import BatchScrapMachine
from LineClearance import LineClearance from LineClearance import LineClearance
import ExcelHandler import ExcelHandler
...@@ -141,6 +142,7 @@ def createObjects(): ...@@ -141,6 +142,7 @@ def createObjects():
G.BatchSourceList=[] G.BatchSourceList=[]
G.BatchReassemblyList=[] G.BatchReassemblyList=[]
G.LineClearanceList=[] G.LineClearanceList=[]
G.BatchScrapMachine=[]
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------
# loop through all the model resources # loop through all the model resources
...@@ -220,6 +222,41 @@ def createObjects(): ...@@ -220,6 +222,41 @@ def createObjects():
G.MachineList.append(M) # add machine to global MachineList G.MachineList.append(M) # add machine to global MachineList
G.ObjList.append(M) # add machine to ObjList G.ObjList.append(M) # add machine to ObjList
elif objClass=='Dream.BatchScrapMachine':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found')
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
scrapQuantity=element.get('scrapQuantity', 'not found')
scrapDistributionType=scrapQuantity.get('distributionType', 'not found')
scrMean=int(scrapQuantity.get('mean', '0'))
scrStdev=float(scrapQuantity.get('stdev', '0'))
scrMin=int(scrapQuantity.get('min', '0'))
scrMax=int(scrapQuantity.get('max', '0'))
failures=element.get('failures', 'not found')
failureDistribution=failures.get('failureDistribution', 'not found')
MTTF=float(failures.get('MTTF', '0'))
MTTR=float(failures.get('MTTR', '0'))
availability=float(failures.get('availability', '0'))
r='None'
for repairman in G.RepairmanList: # check which repairman in the G.RepairmanList
if(id in repairman.coreObjectIds): # (if any) is assigned to repair
r=repairman # the machine with ID equal to id
M=BatchScrapMachine(id, name, 1, distribution=distributionType, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, repairman=r,
mean=mean,stdev=stdev,min=min,max=max, scrMean=scrMean,
scrStdev=scrStdev,scrMin=scrMin,scrMax=scrMax)
M.nextIds=getSuccessorList(id) # update the nextIDs list of the machine
G.MachineList.append(M) # add machine to global MachineList
G.BatchScrapMachine.append(M)
G.ObjList.append(M) # add machine to ObjList
elif objClass=='Dream.MachineJobShop': elif objClass=='Dream.MachineJobShop':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
......
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