Commit 2fd6c80b authored by Georgios Dagkakis's avatar Georgios Dagkakis

capacity stations to be able to consider only entities within threshold

parent 24bfa80b
......@@ -40,7 +40,8 @@ class CapacityStation(Queue):
# the __init__ method of the CapacityStation
#===========================================================================
def __init__(self, id, name, capacity=float("inf"), intervalCapacity=[], schedulingRule="FIFO", gatherWipStat=False,
sharedResources={}, intervalCapacityStart=0,intervalCapacityExceptions={},**kw):
sharedResources={}, intervalCapacityStart=0,intervalCapacityExceptions={},
notProcessOutsideThreshold=False,**kw):
Queue.__init__(self, id, name, capacity=capacity)
# a list that holds the capacity (manhours) that is available in each interval
self.intervalCapacity=intervalCapacity
......@@ -52,6 +53,7 @@ class CapacityStation(Queue):
self.sharedResources=sharedResources
self.intervalCapacityStart=intervalCapacityStart
self.intervalCapacityExceptions=intervalCapacityExceptions
self.notProcessOutsideThreshold=int(notProcessOutsideThreshold)
def initialize(self):
Queue.initialize(self)
......
......@@ -230,7 +230,6 @@ class CapacityStationController(EventGenerator):
# if the buffer was considered before (due to shared resources) continue
if buffer in alreadyConsideredBuffers:
continue
alreadyConsideredBuffers.append(buffer)
sharedBuffers = []
station=buffer.next[0] # get the station
......@@ -261,7 +260,7 @@ class CapacityStationController(EventGenerator):
# if there is no available capacity no need to do anything
if totalAvailableCapacity==0:
continue
while not allCapacityConsumed:
while not allCapacityConsumed:
# list to keep entities that are within a threshold from the EDD
entitiesWithinThreshold=[]
# list to keep entities that are outside a threshold from the EDD
......@@ -270,8 +269,7 @@ class CapacityStationController(EventGenerator):
EDD=float('inf')
for entity in entitiesNotAllocated:
if EDD>entity.capacityProject.dueDate:
EDD=entity.capacityProject.dueDate
EDD=entity.capacityProject.dueDate
# put the entities in the corresponding list according to their due date
for entity in entitiesNotAllocated:
if entity.capacityProject.dueDate-EDD<=self.dueDateThreshold:
......@@ -337,7 +335,9 @@ class CapacityStationController(EventGenerator):
# if we have more entities break
if not haveMoreEntitiesToAllocate:
break
break
if station.notProcessOutsideThreshold:
break
# else calculate the capacity for every entity and create the entities
else:
......
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