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): ...@@ -45,7 +45,8 @@ class BatchReassembly(CoreObject):
# ======================================================================= # =======================================================================
#initialize the id, the capacity of the object and the distribution #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) CoreObject.__init__(self,id, name)
self.type="BatchRassembly" #String that shows the type of object self.type="BatchRassembly" #String that shows the type of object
if not processingTime: if not processingTime:
...@@ -64,6 +65,8 @@ class BatchReassembly(CoreObject): ...@@ -64,6 +65,8 @@ class BatchReassembly(CoreObject):
G.BatchReassemblyList.append(self) G.BatchReassemblyList.append(self)
# flag to show if the objects outputs results # flag to show if the objects outputs results
self.outputResults=bool(int(outputResults)) self.outputResults=bool(int(outputResults))
self.outputFinalWIP=bool(int(outputFinalWIP))
self.finalWIP=[]
# ======================================================================= # =======================================================================
# initialize the internal resource of the object # initialize the internal resource of the object
...@@ -330,6 +333,16 @@ class BatchReassembly(CoreObject): ...@@ -330,6 +333,16 @@ class BatchReassembly(CoreObject):
and activeObjectQueue[0].type!='Batch'\ and activeObjectQueue[0].type!='Batch'\
and giverObjectQueue[0].batchId==activeObjectQueue[0].batchId 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 # outputs results to JSON File
# ======================================================================= # =======================================================================
...@@ -345,7 +358,10 @@ class BatchReassembly(CoreObject): ...@@ -345,7 +358,10 @@ class BatchReassembly(CoreObject):
json['results']['blockage_ratio'] = self.Blockage json['results']['blockage_ratio'] = self.Blockage
json['results']['waiting_ratio'] = self.Waiting json['results']['waiting_ratio'] = self.Waiting
json['results']['off_shift_ratio'] = self.OffShift json['results']['off_shift_ratio'] = self.OffShift
if self.outputFinalWIP:
json['results']['final_WIP'] = self.finalWIP
G.outputJSON['elementList'].append(json) G.outputJSON['elementList'].append(json)
\ No newline at end of file
...@@ -2170,7 +2170,8 @@ ...@@ -2170,7 +2170,8 @@
"top": 0.5350013587825962 "top": 0.5350013587825962
}, },
"id": "St8RA", "id": "St8RA",
"numberOfSubBatches": 8 "numberOfSubBatches": 8,
"outputFinalWIP": 1
}, },
"St8RB": { "St8RB": {
"_class": "Dream.BatchReassembly", "_class": "Dream.BatchReassembly",
...@@ -2178,7 +2179,8 @@ ...@@ -2178,7 +2179,8 @@
"left": 0.9770689321903234, "left": 0.9770689321903234,
"top": 0.960991679081057 "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