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
...@@ -83,21 +83,15 @@ ...@@ -83,21 +83,15 @@
} }
}, },
"edge": { "edge": {
"1": {
"source": "O2",
"destination": "OP1",
"data": {},
"_class": "Dream.Edge"
},
"0": { "0": {
"source": "O1", "source": "O1",
"destination": "OP1", "destination": "OP1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"3": { "1": {
"source": "OP1", "source": "O2",
"destination": "M1", "destination": "OP1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
...@@ -107,9 +101,9 @@ ...@@ -107,9 +101,9 @@
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
"5": { "3": {
"source": "OP1", "source": "OP1",
"destination": "MA1", "destination": "M1",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
}, },
...@@ -118,13 +112,19 @@ ...@@ -118,13 +112,19 @@
"destination": "M2", "destination": "M2",
"data": {}, "data": {},
"_class": "Dream.Edge" "_class": "Dream.Edge"
},
"5": {
"source": "OP1",
"destination": "MA1",
"data": {},
"_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"
...@@ -144,9 +144,12 @@ ...@@ -144,9 +144,12 @@
{ {
"operator": "O1", "operator": "O1",
"processingTime": { "processingTime": {
"operationType": 1, "Fixed": {
"distributionType": "Fixed",
"mean": 1.0 "mean": 1.0
}
},
"operationType": {
"Processing": 1
}, },
"stationIdsList": [ "stationIdsList": [
"M0" "M0"
...@@ -176,9 +179,12 @@ ...@@ -176,9 +179,12 @@
{ {
"operator": "O1", "operator": "O1",
"processingTime": { "processingTime": {
"operationType": 1, "Fixed": {
"distributionType": "Fixed", "mean": 2
"mean": "2" }
},
"operationType": {
"Processing": 1
}, },
"stationIdsList": [ "stationIdsList": [
"M1", "M1",
...@@ -221,9 +227,12 @@ ...@@ -221,9 +227,12 @@
{ {
"operator": "O1", "operator": "O1",
"processingTime": { "processingTime": {
"operationType": 1, "Fixed": {
"distributionType": "Fixed", "mean": 1
"mean": "1" }
},
"operationType": {
"Processing": 1
}, },
"stationIdsList": [ "stationIdsList": [
"M1", "M1",
...@@ -264,11 +273,13 @@ ...@@ -264,11 +273,13 @@
"sequence": "4" "sequence": "4"
}, },
{ {
"operator": "O1",
"processingTime": { "processingTime": {
"operationType": 1, "Fixed": {
"distributionType": "Fixed", "mean": 3
"mean": "3" }
},
"operationType": {
"Processing": 1
}, },
"stationIdsList": [ "stationIdsList": [
"M1", "M1",
...@@ -302,9 +313,12 @@ ...@@ -302,9 +313,12 @@
{ {
"operator": "O2", "operator": "O2",
"processingTime": { "processingTime": {
"operationType": 1, "Fixed": {
"distributionType": "Fixed", "mean": 1
"mean": "1" }
},
"operationType": {
"Processing": 1
}, },
"stationIdsList": [ "stationIdsList": [
"MA1" "MA1"
......
...@@ -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