Commit dfe8d623 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Ioannis Papagiannopoulos

changes so that BOM info is read correctly by the objects

parent df7a90e1
{ {
"graph": { "graph": {
"node": { "node": {
"Q1": { "Q1": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.ConditionalBuffer", "_class": "Dream.ConditionalBuffer",
"name": "Queue1", "name": "Queue1",
"isDummy": "0" "isDummy": "0"
}, },
"MA1": { "MA1": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.MouldAssembly", "_class": "Dream.MouldAssembly",
"id": "MA1", "id": "MA1",
"operationType": "Load", "operationType": "Load",
"name": "Assembly" "name": "Assembly"
}, },
"OP1": { "OP1": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.OperatorPool", "_class": "Dream.OperatorPool",
"capacity": 2, "capacity": 2,
"name": "Operator Pool 1" "name": "Operator Pool 1"
}, },
"Q0": { "Q0": {
"capacity": -1, "capacity": -1,
"name": "StartQueue", "name": "StartQueue",
"isDummy": "0", "isDummy": "0",
"wip": [ "wip": [
{ {
"id": "OD1", "id": "OD1",
"sequence": "1" "sequence": "1"
} }
], ],
"interruptions": {}, "interruptions": {},
"_class": "Dream.ConditionalBuffer" "_class": "Dream.ConditionalBuffer"
}, },
"OD0": { "OD0": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.OrderDecomposition", "_class": "Dream.OrderDecomposition",
"name": "Order Decomposition" "name": "Order Decomposition"
}, },
"AB1": { "AB1": {
"capacity": -1, "capacity": -1,
"name": "Assembly Buffer", "name": "Assembly Buffer",
"isDummy": "0", "isDummy": "0",
"interruptions": {}, "interruptions": {},
"_class": "Dream.MouldAssemblyBuffer", "_class": "Dream.MouldAssemblyBuffer",
"id": "AB1" "id": "AB1"
}, },
"M1": { "M1": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.MachineJobShop", "_class": "Dream.MachineJobShop",
"name": "Machine1", "name": "Machine1",
"operationType": "Load" "operationType": "Load"
}, },
"M0": { "M0": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.MachineJobShop", "_class": "Dream.MachineJobShop",
"name": "Design", "name": "Design",
"operationType": "Load" "operationType": "Load"
}, },
"M2": { "M2": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.MachineJobShop", "_class": "Dream.MachineJobShop",
"name": "Machine2", "name": "Machine2",
"operationType": "Load" "operationType": "Load"
}, },
"E1": { "E1": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.ExitJobShop", "_class": "Dream.ExitJobShop",
"name": "Exit" "name": "Exit"
}, },
"O2": { "O2": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.Operator", "_class": "Dream.Operator",
"capacity": 1, "capacity": 1,
"name": "Operator2" "name": "Operator2"
}, },
"O1": { "O1": {
"interruptions": {}, "interruptions": {},
"_class": "Dream.Operator", "_class": "Dream.Operator",
"capacity": 1, "capacity": 1,
"name": "Operator1" "name": "Operator1"
} }
}, },
"edge": { "edge": {
"1": { "0": {
"source": "O2", "source": "O1",
"destination": "OP1", "destination": "OP1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"0": { "1": {
"source": "O1", "source": "O2",
"destination": "OP1", "destination": "OP1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"3": { "2": {
"source": "OP1", "source": "OP1",
"destination": "M1", "destination": "M0",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"2": { "3": {
"source": "OP1", "source": "OP1",
"destination": "M0", "destination": "M1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"5": { "4": {
"source": "OP1", "source": "OP1",
"destination": "MA1", "destination": "M2",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"4": { "5": {
"source": "OP1", "source": "OP1",
"destination": "M2", "destination": "MA1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
} }
} }
}, },
"general": { "general": {
"console": "No", "console": "No",
"numberOfReplications": "1", "numberOfReplications": "1",
"trace": "No", "trace": "Yes",
"confidenceLevel": "0.95", "confidenceLevel": "0.95",
"maxSimTime": "-1", "maxSimTime": "-1",
"_class": "Dream.Configuration" "_class": "Dream.Configuration"
}, },
"BOM": { "BOM": {
"productionOrders": [ "productionOrders": [
{ {
"componentsList": [ "componentsList": [
{ {
"route": [ "route": [
{ {
"stationIdsList": [ "stationIdsList": [
"Q0" "Q0"
], ],
"sequence": "1" "sequence": "1"
}, },
{ {
"operator": "O1", "operator": "O1",
"processingTime": { "processingTime": {
"operationType": 1, "Fixed": {
"distributionType": "Fixed", "mean": 1.0
"mean": 1.0 }
}, },
"stationIdsList": [ "operationType": {
"M0" "Processing": 1
], },
"sequence": "1" "stationIdsList": [
} "M0"
], ],
"_class": "Dream.OrderDesign", "sequence": "1"
"id": "OD1", }
"name": "OrderDesign1" ],
}, "_class": "Dream.OrderDesign",
{ "id": "OD1",
"componentType": "Mold Insert", "name": "OrderDesign1"
"route": [ },
{ {
"stationIdsList": [ "componentType": "Mold Insert",
"OD0" "route": [
], {
"sequence": "" "stationIdsList": [
}, "OD0"
{ ],
"stationIdsList": [ "sequence": ""
"Q1" },
], {
"sequence": "2" "stationIdsList": [
}, "Q1"
{ ],
"operator": "O1", "sequence": "2"
"processingTime": { },
"operationType": 1, {
"distributionType": "Fixed", "operator": "O1",
"mean": "2" "processingTime": {
}, "Fixed": {
"stationIdsList": [ "mean": 2
"M1", }
"M2" },
], "operationType": {
"sequence": "2" "Processing": 1
}, },
{ "stationIdsList": [
"stationIdsList": [ "M1",
"AB1" "M2"
], ],
"sequence": "6" "sequence": "2"
}, },
{ {
"stationIdsList": [ "stationIdsList": [
"MA1" "AB1"
], ],
"sequence": "6" "sequence": "6"
} },
], {
"_class": "Dream.OrderComponent", "stationIdsList": [
"id": "C1", "MA1"
"name": "Component1" ],
}, "sequence": "6"
{ }
"componentType": "Misc", ],
"route": [ "_class": "Dream.OrderComponent",
{ "id": "C1",
"stationIdsList": [ "name": "Component1"
"OD0" },
], {
"sequence": "" "componentType": "Misc",
}, "route": [
{ {
"stationIdsList": [ "stationIdsList": [
"Q1" "OD0"
], ],
"sequence": "3" "sequence": ""
}, },
{ {
"operator": "O1", "stationIdsList": [
"processingTime": { "Q1"
"operationType": 1, ],
"distributionType": "Fixed", "sequence": "3"
"mean": "1" },
}, {
"stationIdsList": [ "operator": "O1",
"M1", "processingTime": {
"M2" "Fixed": {
], "mean": 1
"sequence": "3" }
}, },
{ "operationType": {
"stationIdsList": [ "Processing": 1
"AB1" },
], "stationIdsList": [
"sequence": "6" "M1",
}, "M2"
{ ],
"stationIdsList": [ "sequence": "3"
"MA1" },
], {
"sequence": "6" "stationIdsList": [
} "AB1"
], ],
"_class": "Dream.OrderComponent", "sequence": "6"
"id": "C2", },
"name": "Component2" {
}, "stationIdsList": [
{ "MA1"
"componentType": "K-Standards", ],
"route": [ "sequence": "6"
{ }
"stationIdsList": [ ],
"OD0" "_class": "Dream.OrderComponent",
], "id": "C2",
"sequence": "" "name": "Component2"
}, },
{ {
"stationIdsList": [ "componentType": "K-Standards",
"Q1" "route": [
], {
"sequence": "4" "stationIdsList": [
}, "OD0"
{ ],
"operator": "O1", "sequence": ""
"processingTime": { },
"operationType": 1, {
"distributionType": "Fixed", "stationIdsList": [
"mean": "3" "Q1"
}, ],
"stationIdsList": [ "sequence": "4"
"M1", },
"M2" {
], "processingTime": {
"requiredParts": [ "Fixed": {
"C2", "mean": 3
"C1" }
], },
"sequence": "4" "operationType": {
}, "Processing": 1
{ },
"stationIdsList": [ "stationIdsList": [
"AB1" "M1",
], "M2"
"sequence": "6" ],
}, "requiredParts": [
{ "C2",
"stationIdsList": [ "C1"
"MA1" ],
], "sequence": "4"
"sequence": "6" },
} {
], "stationIdsList": [
"_class": "Dream.OrderComponent", "AB1"
"id": "C3", ],
"name": "Component3" "sequence": "6"
}, },
{ {
"route": [ "stationIdsList": [
{ "MA1"
"operator": "O2", ],
"processingTime": { "sequence": "6"
"operationType": 1, }
"distributionType": "Fixed", ],
"mean": "1" "_class": "Dream.OrderComponent",
}, "id": "C3",
"stationIdsList": [ "name": "Component3"
"MA1" },
], {
"sequence": "6" "route": [
}, {
{ "operator": "O2",
"stationIdsList": [ "processingTime": {
"E1" "Fixed": {
], "mean": 1
"sequence": "6" }
} },
], "operationType": {
"_class": "Dream.Mould", "Processing": 1
"id": "Mo1", },
"name": "Mould1" "stationIdsList": [
} "MA1"
], ],
"_class": "Dream.Order", "sequence": "6"
"id": "O1", },
"name": "Order 1" {
} "stationIdsList": [
] "E1"
}, ],
"_class": "Dream.Simulation" "sequence": "6"
}
],
"_class": "Dream.Mould",
"id": "Mo1",
"name": "Mould1"
}
],
"_class": "Dream.Order",
"id": "O1",
"name": "Order 1"
}
]
},
"_class": "Dream.Simulation"
} }
\ No newline at end of file
...@@ -58,14 +58,16 @@ class Job(Entity): # inherits from the Entity c ...@@ -58,14 +58,16 @@ class Job(Entity): # inherits from the Entity c
self.routeInBOM=False 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 # 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: if self.remainingRoute:
initialSetup=self.remainingRoute[0].get('setupTime',{}) # the setupTime dict of the first step # the setupType of the first step
initialSetupType=0 initialSetupType=self.remainingRoute[0].get('operationType',{}).get('Setup',0)
if initialSetup: initialProcessingType=self.remainingRoute[0].get('operationType',{}).get('Processing',0)
initialSetupType=initialSetup.get('operationType',0) # initialSetupType=0
initialProcessing=self.remainingRoute[0].get('processingTime',{}) # the processingTime dict of the first step # if initialSetup:
initialProcessingType=0 # initialSetupType=initialSetup.get('operationType',0)
if initialProcessing: # initialProcessing=self.remainingRoute[0].get('processingTime',{}) # the processingTime dict of the first step
initialProcessingType=initialProcessing.get('operationType',0) # initialProcessingType=0
# if initialProcessing:
# initialProcessingType=initialProcessing.get('operationType',0)
self.initialOperationTypes={"Setup":initialSetupType, self.initialOperationTypes={"Setup":initialSetupType,
"Processing":initialProcessingType} "Processing":initialProcessingType}
......
...@@ -248,8 +248,8 @@ class MachineJobShop(Machine): ...@@ -248,8 +248,8 @@ class MachineJobShop(Machine):
activeEntity=entity activeEntity=entity
# read the definition of the time from the remainingRoute dict # read the definition of the time from the remainingRoute dict
if not self.isProcessingInitialWIP: if not self.isProcessingInitialWIP:
time=activeEntity.remainingRoute[0].get(str(typeDict[str(type)]),{}) operationTypeDict=activeEntity.remainingRoute[0].get('operationType',{})
operationType=time.get('operationType', 'not defined') operationType=operationTypeDict.get(str(type),'not defined')
else: # if the active entity is initialWIP at the start of simulation else: # if the active entity is initialWIP at the start of simulation
operationType=activeEntity.initialOperationTypes.get(str(type),'not defined') operationType=activeEntity.initialOperationTypes.get(str(type),'not defined')
# if the operationType is not 'not defined' # if the operationType is not 'not defined'
......
...@@ -243,31 +243,27 @@ class MouldAssembly(MachineJobShop): ...@@ -243,31 +243,27 @@ class MouldAssembly(MachineJobShop):
self.rng=RandomNumberGenerator(self, processingTime) self.rng=RandomNumberGenerator(self, processingTime)
self.procTime=self.rng.generateNumber() self.procTime=self.rng.generateNumber()
# update the activeObject's processing time according to the readings in the mould's route # update the activeObject's processing time according to the readings in the mould's route
processDistType=processingTime.get('distributionType','not found') processDistType=processingTime.keys()[0]
procTime=float(processingTime.get('mean', 0)) procTime=float(processingTime[processDistType].get('mean', 0))
processOpType=processingTime.get('operationType','not found') # can be manual/automatic processOpType=firstStep.get('operationType',{}).get('Processing','not found') # can be manual/automatic
# setup operation # setup operation
setupTime=firstStep.get('setupTime',None) setupTime=firstStep.get('setupTime',None)
if setupTime: if setupTime:
setupTime=self.getOperationTime(setupTime) setupTime=self.getOperationTime(setupTime)
self.stpRng=RandomNumberGenerator(self, **setupTime) self.stpRng=RandomNumberGenerator(self, setupTime)
# update the activeObject's processing time according to the readings in the mould's route # update the activeObject's processing time according to the readings in the mould's route
setupDistType=setupTime.get('distributionType','not found') setupDistType=setupTime.getkeys()[0]
setTime=float(setupTime.get('mean', 0)) setTime=float(setupTime[setupDistType].get('mean', 0))
setupOpType=setupTime.get('operationType','not found') # can be manual/automatic setupOpType=firstStep.get('operationType',{}).get('Setup','not found') # can be manual/automatic
# update the first step of the route with the activeObjects id as sole element of the stationIdsList # update the first step of the route with the activeObjects id as sole element of the stationIdsList
route.insert(0, {'stationIdsList':[str(self.id)],'processingTime':{'distributionType':str(processDistType),\ route.insert(0, {'stationIdsList':[str(self.id)],'processingTime':{str(processDistType):{'mean':str(procTime)}},\
'mean':str(procTime),\ 'setupTime':{str(setupDistType):{'mean':str(setupTime)}},
'operationType':str(processOpType)},\ 'operationType':{'Processing':processOpType,'Setup':setupOpType}})
'setupTime':{'distributionType':str(setupDistType),\
'mean':str(setupTime),\
'operationType':str(setupOpType)}})
else: else:
# update the first step of the route with the activeObjects id as sole element of the stationIdsList # update the first step of the route with the activeObjects id as sole element of the stationIdsList
route.insert(0, {'stationIdsList':[str(self.id)],'processingTime':{'distributionType':str(processDistType),\ route.insert(0, {'stationIdsList':[str(self.id)],'processingTime':{str(processDistType):{'mean':str(procTime)}},
'mean':str(procTime),\ 'operationType':{'Processing':processOpType}})
'operationType':str(processOpType)}})
#Below it is to assign an exit if it was not assigned in JSON #Below it is to assign an exit if it was not assigned in JSON
#have to talk about it with NEX #have to talk about it with NEX
exitAssigned=False exitAssigned=False
......
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