Commit 22f44ccc authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

CapacityStations also output a detailed workplan

parent c327ada6
......@@ -52,7 +52,8 @@ class CapacityStation(Queue):
Queue.initialize(self)
self.remainingIntervalCapacity=list(self.intervalCapacity)
self.isLocked=True
self.utilisationDict=[] # a list of dicts for the results
self.utilisationDict=[] # a list of dicts for the utilization results
self.detailedWorkPlan=[] # a list of dicts to keep detailed data
def canAccept(self, callerObject=None):
if self.isLocked:
......@@ -74,5 +75,6 @@ class CapacityStation(Queue):
for entry in self.utilisationDict:
meanUtilization+=entry['utilization']/float(len(self.utilisationDict))
json['results']['meanUtilization']=meanUtilization
json['results']['detailedWorkPlan']=self.detailedWorkPlan
G.outputJSON['elementList'].append(json)
\ No newline at end of file
......@@ -116,6 +116,10 @@ class CapacityStationController(EventGenerator):
buffer.entityRemoved=self.env.event()
project=entity.capacityProject
periodDict[project.id]=entity.requiredCapacity
station.detailedWorkPlan.append({'time':self.env.now,
'operation':station.id,
'project':project.id,
'allocation':entity.requiredCapacity})
capacityAllocated+=entity.requiredCapacity
if self.checkIfProjectJustStartsInStation(project, station):
project.projectSchedule.append({"station": station.id,"start": self.env.now})
......
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