Commit 254c2ed9 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

changes so that BOM info is read correctly by the objects

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