Commit 2222a11b authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

comments added

parent 03b05cba
...@@ -72,6 +72,7 @@ class CapacityStationController(EventGenerator): ...@@ -72,6 +72,7 @@ class CapacityStationController(EventGenerator):
exit.currentlyObtainedEntities.append(entity) exit.currentlyObtainedEntities.append(entity)
station.entityRemoved=self.env.event() station.entityRemoved=self.env.event()
project=entity.capacityProject project=entity.capacityProject
# output the finish time of the project. This will updated every time, so in the end it should be correct
for entry in project.projectSchedule: for entry in project.projectSchedule:
if entry['station']==station.id: if entry['station']==station.id:
entry['finish']=self.env.now entry['finish']=self.env.now
...@@ -115,7 +116,8 @@ class CapacityStationController(EventGenerator): ...@@ -115,7 +116,8 @@ class CapacityStationController(EventGenerator):
yield buffer.entityRemoved yield buffer.entityRemoved
buffer.entityRemoved=self.env.event() buffer.entityRemoved=self.env.event()
project=entity.capacityProject project=entity.capacityProject
periodDict[project.id]=entity.requiredCapacity periodDict[project.id]=entity.requiredCapacity # dict to be appended in the utilization list
# append the move in the detailedWorkPlan of the station
station.detailedWorkPlan.append({'time':self.env.now, station.detailedWorkPlan.append({'time':self.env.now,
'operation':station.id, 'operation':station.id,
'project':project.id, 'project':project.id,
...@@ -125,7 +127,9 @@ class CapacityStationController(EventGenerator): ...@@ -125,7 +127,9 @@ class CapacityStationController(EventGenerator):
project.projectSchedule.append({"station": station.id,"start": self.env.now}) project.projectSchedule.append({"station": station.id,"start": self.env.now})
# lock the station # lock the station
station.isLocked=True station.isLocked=True
# calculate the utilization
periodDict['utilization']=capacityAllocated/float(capacityAvailable) periodDict['utilization']=capacityAllocated/float(capacityAvailable)
# update the utilisationDict of the station
station.utilisationDict.append(periodDict) station.utilisationDict.append(periodDict)
# for every station update the remaining interval capacity so that it is ready for next loop # for every station update the remaining interval capacity so that it is ready for next loop
......
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