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): ...@@ -40,7 +40,8 @@ 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={}, intervalCapacityStart=0,intervalCapacityExceptions={},**kw): sharedResources={}, intervalCapacityStart=0,intervalCapacityExceptions={},
notProcessOutsideThreshold=False,**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
...@@ -52,6 +53,7 @@ class CapacityStation(Queue): ...@@ -52,6 +53,7 @@ class CapacityStation(Queue):
self.sharedResources=sharedResources self.sharedResources=sharedResources
self.intervalCapacityStart=intervalCapacityStart self.intervalCapacityStart=intervalCapacityStart
self.intervalCapacityExceptions=intervalCapacityExceptions self.intervalCapacityExceptions=intervalCapacityExceptions
self.notProcessOutsideThreshold=int(notProcessOutsideThreshold)
def initialize(self): def initialize(self):
Queue.initialize(self) Queue.initialize(self)
......
...@@ -230,7 +230,6 @@ class CapacityStationController(EventGenerator): ...@@ -230,7 +230,6 @@ class CapacityStationController(EventGenerator):
# if the buffer was considered before (due to shared resources) continue # if the buffer was considered before (due to shared resources) continue
if buffer in alreadyConsideredBuffers: if buffer in alreadyConsideredBuffers:
continue continue
alreadyConsideredBuffers.append(buffer) alreadyConsideredBuffers.append(buffer)
sharedBuffers = [] sharedBuffers = []
station=buffer.next[0] # get the station station=buffer.next[0] # get the station
...@@ -271,7 +270,6 @@ class CapacityStationController(EventGenerator): ...@@ -271,7 +270,6 @@ class CapacityStationController(EventGenerator):
for entity in entitiesNotAllocated: for entity in entitiesNotAllocated:
if EDD>entity.capacityProject.dueDate: 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 # put the entities in the corresponding list according to their due date
for entity in entitiesNotAllocated: for entity in entitiesNotAllocated:
if entity.capacityProject.dueDate-EDD<=self.dueDateThreshold: if entity.capacityProject.dueDate-EDD<=self.dueDateThreshold:
...@@ -338,6 +336,8 @@ class CapacityStationController(EventGenerator): ...@@ -338,6 +336,8 @@ class CapacityStationController(EventGenerator):
# if we have more entities break # if we have more entities break
if not haveMoreEntitiesToAllocate: if not haveMoreEntitiesToAllocate:
break break
if station.notProcessOutsideThreshold:
break
# else calculate the capacity for every entity and create the entities # else calculate the capacity for every entity and create the entities
else: 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