Commit 80b89fe2 authored by Georgios Dagkakis's avatar Georgios Dagkakis

rolling capacity can start not from beginning and also have exceptions

parent d329564c
......@@ -40,7 +40,7 @@ class CapacityStation(Queue):
# the __init__ method of the CapacityStation
#===========================================================================
def __init__(self, id, name, capacity=float("inf"), intervalCapacity=[], schedulingRule="FIFO", gatherWipStat=False,
sharedResources={}, **kw):
sharedResources={}, intervalCapacityStart=0,intervalCapacityExceptions={},**kw):
Queue.__init__(self, id, name, capacity=capacity)
# a list that holds the capacity (manhours) that is available in each interval
self.intervalCapacity=intervalCapacity
......@@ -50,6 +50,8 @@ class CapacityStation(Queue):
self.isLocked=True
# dict that holds information if station shares workpower with some other station
self.sharedResources=sharedResources
self.intervalCapacityStart=intervalCapacityStart
self.intervalCapacityExceptions=intervalCapacityExceptions
def initialize(self):
Queue.initialize(self)
......@@ -64,6 +66,8 @@ class CapacityStation(Queue):
break
# initialize variables
self.remainingIntervalCapacity=list(self.intervalCapacity)
for i in range(self.intervalCapacityStart):
self.remainingIntervalCapacity.pop(0)
self.isLocked=True
self.utilisationDict=[] # a list of dicts for the utilization results
self.detailedWorkPlan=[] # a list of dicts to keep detailed data
......
......@@ -162,7 +162,10 @@ class CapacityStationController(EventGenerator):
# if remainingIntervalCapacity is empty reset it (to obtain rolling capacity)
if len(station.remainingIntervalCapacity)==0:
station.remainingIntervalCapacity=list(station.intervalCapacity)
# ig the next interval is in the exceptions update the capacity accordingly
if str((self.env.now)+1.0) in station.intervalCapacityExceptions.keys():
station.remainingIntervalCapacity[0]=station.intervalCapacityExceptions[str((self.env.now)+1)]
# invoked after entities have exited one station to create
# the corresponding entities to the following buffer
def createInCapacityStationBuffers(self):
......
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