Commit a468d6ac authored by Georgios Dagkakis's avatar Georgios Dagkakis

batchReassembly to be able to output the final WIP

parent 091ef4da
......@@ -45,7 +45,8 @@ class BatchReassembly(CoreObject):
# =======================================================================
#initialize the id, the capacity of the object and the distribution
# =======================================================================
def __init__(self, id, name, numberOfSubBatches=1, processingTime=None, operator='None', outputResults=False, **kw):
def __init__(self, id, name, numberOfSubBatches=1, processingTime=None, operator='None', outputResults=False,
outputFinalWIP=False,**kw):
CoreObject.__init__(self,id, name)
self.type="BatchRassembly" #String that shows the type of object
if not processingTime:
......@@ -64,6 +65,8 @@ class BatchReassembly(CoreObject):
G.BatchReassemblyList.append(self)
# flag to show if the objects outputs results
self.outputResults=bool(int(outputResults))
self.outputFinalWIP=bool(int(outputFinalWIP))
self.finalWIP=[]
# =======================================================================
# initialize the internal resource of the object
......@@ -329,7 +332,17 @@ class BatchReassembly(CoreObject):
and len(activeObjectQueue)<activeObject.numberOfSubBatches\
and activeObjectQueue[0].type!='Batch'\
and giverObjectQueue[0].batchId==activeObjectQueue[0].batchId
# =======================================================================
# actions to be taken after the simulation ends
# =======================================================================
def postProcessing(self, MaxSimtime=None):
CoreObject.postProcessing(self, MaxSimtime)
currentWIP=0
for subBatch in self.getActiveObjectQueue():
currentWIP+=subBatch.numberOfUnits
self.finalWIP.append(currentWIP)
# =======================================================================
# outputs results to JSON File
# =======================================================================
......@@ -345,7 +358,10 @@ class BatchReassembly(CoreObject):
json['results']['blockage_ratio'] = self.Blockage
json['results']['waiting_ratio'] = self.Waiting
json['results']['off_shift_ratio'] = self.OffShift
if self.outputFinalWIP:
json['results']['final_WIP'] = self.finalWIP
G.outputJSON['elementList'].append(json)
\ No newline at end of file
......@@ -2170,7 +2170,8 @@
"top": 0.5350013587825962
},
"id": "St8RA",
"numberOfSubBatches": 8
"numberOfSubBatches": 8,
"outputFinalWIP": 1
},
"St8RB": {
"_class": "Dream.BatchReassembly",
......@@ -2178,7 +2179,8 @@
"left": 0.9770689321903234,
"top": 0.960991679081057
},
"numberOfSubBatches": 8
"numberOfSubBatches": 8,
"outputFinalWIP": 1
}
}
},
......
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