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