Commit 24bfa80b authored by Georgios Dagkakis's avatar Georgios Dagkakis

correction in CapacityStationController

parent 7fb06de1
...@@ -257,7 +257,6 @@ class CapacityStationController(EventGenerator): ...@@ -257,7 +257,6 @@ class CapacityStationController(EventGenerator):
# list to keep entities that have not been already allocated # list to keep entities that have not been already allocated
entitiesNotAllocated=list(entitiesConsidered) entitiesNotAllocated=list(entitiesConsidered)
allCapacityConsumed=False allCapacityConsumed=False
# if there is no available capacity no need to do anything # if there is no available capacity no need to do anything
if totalAvailableCapacity==0: if totalAvailableCapacity==0:
...@@ -282,15 +281,17 @@ class CapacityStationController(EventGenerator): ...@@ -282,15 +281,17 @@ class CapacityStationController(EventGenerator):
# calculate the total capacity that is requested # calculate the total capacity that is requested
totalRequestedCapacity=0 totalRequestedCapacity=0
# do not to count projects that cannot move due to space limitations
# so check according to considered capacity
consideredSpace=float(availableSpace)
for entity in entitiesWithinThreshold: for entity in entitiesWithinThreshold:
# get buffer where the entity is and the station it requests to get in # get buffer where the entity is and the station it requests to get in
entityBuffer=entity.currentStation entityBuffer=entity.currentStation
entityStation=entity.currentStation.next[0] entityStation=entity.currentStation.next[0]
# entities that cannot start (due to space, need for assembly or earliest start)
# do not request for capacity
if self.checkIfProjectCanStartInStation(entity.capacityProject, entityStation) and\ if self.checkIfProjectCanStartInStation(entity.capacityProject, entityStation) and\
(not self.checkIfProjectNeedsToBeAssembled(entity.capacityProject, entityBuffer))\ (not self.checkIfProjectNeedsToBeAssembled(entity.capacityProject, entityBuffer))\
and self.checkIfThereIsEnoughSpace(entity, entityBuffer, availableSpace): and self.checkIfThereIsEnoughSpace(entity, entityBuffer, consideredSpace):
consideredSpace-=entity.capacityProject.assemblySpaceRequirement
totalRequestedCapacity+=entity.requiredCapacity totalRequestedCapacity+=entity.requiredCapacity
# if there is enough capacity for all the entities set them that they all should move # if there is enough capacity for all the entities set them that they all should move
......
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