Commit 672da092 authored by Georgios Dagkakis's avatar Georgios Dagkakis

Machine to be able to count and ouput break time

parent 4320b0f8
......@@ -54,6 +54,7 @@ class CoreObject(ManPyObject):
self.WaitingForLoadOperator=[]
self.Loading = []
self.SettingUp =[]
self.OnBreak =[]
# list that holds the objectInterruptions that have this element as victim
self.objectInterruptions=[]
......@@ -639,7 +640,15 @@ class CoreObject(ManPyObject):
# if object is off shift add only the fail time before the shift ended
if not self.onShift and self.timeLastFailure < self.timeLastShiftEnded:
self.totalFailureTime+=self.timeLastShiftEnded-self.timeLastFailure
# if the Operator is on break we have to add this break time to its total break time
if self.onBreak:
if self.onShift:
self.totalBreakTime+=self.env.now-self.timeLastBreakStarted
# if object is off shift add only the break time before the shift ended
if not self.onShift and self.timeLastBreakStarted < self.timeLastShiftEnded:
self.totalBreakTime+=self.timeLastShiftEnded-self.timeLastBreakStarted
#if the object is off shift,add this to the off-shift time
if activeObject.onShift==False:
# if we ran the simulation for infinite time we have to identify the last event
......@@ -654,7 +663,7 @@ class CoreObject(ManPyObject):
self.totalOffShiftTime+=now-self.timeLastShiftEnded
#object was idle when it was not in any other state
activeObject.totalWaitingTime=MaxSimtime-activeObject.totalWorkingTime-activeObject.totalBlockageTime-activeObject.totalFailureTime-activeObject.totalLoadTime-activeObject.totalSetupTime-self.totalOffShiftTime
activeObject.totalWaitingTime=MaxSimtime-activeObject.totalWorkingTime-activeObject.totalBlockageTime-activeObject.totalFailureTime-activeObject.totalLoadTime-activeObject.totalSetupTime-self.totalOffShiftTime-self.totalBreakTime
if activeObject.totalBlockageTime<0 and activeObject.totalBlockageTime>-0.00001: #to avoid some effects of getting negative cause of rounding precision
self.totalBlockageTime=0
......@@ -671,6 +680,7 @@ class CoreObject(ManPyObject):
activeObject.Loading.append(100*self.totalLoadTime/MaxSimtime)
activeObject.SettingUp.append(100*self.totalSetupTime/MaxSimtime)
activeObject.OffShift.append(100*self.totalOffShiftTime/MaxSimtime)
activeObject.OnBreak.append(100*self.totalBreakTime/MaxSimtime)
activeObject.WipStat.append(self.wipStatList.tolist())
# =======================================================================
......
{
"graph": {
"node": {
"E1": {
"interruptions": {},
"top": 0.05688622754491013,
"_class": "Dream.Exit",
"left": 0.7083333333333333
},
"S1": {
"name": "Source",
"top": 0.9431137724550899,
"entity": "Dream.Part",
"interArrivalTime": {
"Fixed": {
"distributionType": "Fixed",
"mean": 6
}
},
"interruptions": {},
"_class": "Dream.Source",
"left": 0.30208333333333337
},
"M1": {
"name": "Machine1",
"top": 0.5,
"processingTime": {
"Fixed": {
"mean": 3.0
}
},
"interruptions": {
"break": {
"TTR": {
"Fixed": {
"mean": 5
}
},
"TTB": {
"Fixed": {
"mean": 40
}
}
}
},
"operationType": "MT-Load-Processing",
"_class": "Dream.Machine",
"left": 0.5625
}
},
"edge": {
"3": {
"source": "M1",
"destination": "E1",
"data": {},
"_class": "Dream.Edge"
},
"2": {
"source": "S1",
"destination": "M1",
"data": {},
"_class": "Dream.Edge"
}
}
},
"_class": "Dream.Simulation",
"general": {
"console": "No",
"numberOfReplications": "1",
"trace": "No",
"confidenceLevel": "0.95",
"maxSimTime": "100",
"_class": "Dream.Configuration"
}
}
\ No newline at end of file
......@@ -1245,6 +1245,7 @@ class Machine(CoreObject):
json['results']['off_shift_ratio'] = self.OffShift
json['results']['setup_ratio'] = self.SettingUp
json['results']['loading_ratio'] = self.Loading
json['results']['break_ratio'] = self.OnBreak
G.outputJSON['elementList'].append(json)
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