Commit 2657ed18 authored by Georgios Dagkakis's avatar Georgios Dagkakis

correction for better calculation of what is to be processed

parent 72c1fba6
...@@ -222,12 +222,15 @@ class CapacityStationController(EventGenerator): ...@@ -222,12 +222,15 @@ class CapacityStationController(EventGenerator):
allCapacityConsumed=False allCapacityConsumed=False
# 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
if totalRequestedCapacity<totalAvailableCapacity: if totalRequestedCapacity<=totalAvailableCapacity:
for entity in entitiesWithinThreshold: for entity in entitiesWithinThreshold:
if self.checkIfProjectCanStartInStation(entity.capacityProject, station) and\ if self.checkIfProjectCanStartInStation(entity.capacityProject, station) and\
(not self.checkIfProjectNeedsToBeAssembled(entity.capacityProject, buffer)): (not self.checkIfProjectNeedsToBeAssembled(entity.capacityProject, buffer)):
entity.shouldMove=True entity.shouldMove=True
# check if all the capacity is consumed to update the flag
if totalRequestedCapacity==totalAvailableCapacity:
allCapacityConsumed=True
# else calculate the capacity for every entity and create the entities # else calculate the capacity for every entity and create the entities
else: else:
allCapacityConsumed=True allCapacityConsumed=True
......
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