Commit b1198f4d authored by Georgios Dagkakis's avatar Georgios Dagkakis

CoreObjects to calculate queue level at the end of simulation. Also operators...

CoreObjects to calculate queue level at the end of simulation. Also operators to ouput schedule even if empty
parent 17497fcd
......@@ -603,6 +603,9 @@ class CoreObject(ManPyObject):
activeObject=self.getActiveObject()
activeObjectQueue=self.getActiveObjectQueue()
import numpy
self.wipStatList=numpy.concatenate((self.wipStatList,[[self.env.now, len(activeObjectQueue)]]))
#calculate the offShift time for current entity
offShiftTimeInCurrentEntity=0
......
......@@ -284,18 +284,17 @@ class Operator(ObjectResource):
json['results']['waiting_ratio'] = self.Waiting
json['results']['off_shift_ratio'] = self.OffShift
if self.ouputSchedule:
if self.schedule:
json['results']['schedule']=[]
for record in self.schedule:
if len(record)==3:
json['results']['schedule'].append({
'stationId':record[0].id,
'entranceTime':record[1],
'exitTime':record[2]})
else:
json['results']['schedule'].append({
'stationId':record[0].id,
'entranceTime':record[1]})
json['results']['schedule']=[]
for record in self.schedule:
if len(record)==3:
json['results']['schedule'].append({
'stationId':record[0].id,
'entranceTime':record[1],
'exitTime':record[2]})
else:
json['results']['schedule'].append({
'stationId':record[0].id,
'entranceTime':record[1]})
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