Commit c1121f3d authored by Georgios Dagkakis's avatar Georgios Dagkakis

corrections in CapacityStationController

parent 3f478bc5
......@@ -373,8 +373,8 @@ class CapacityStationController(EventGenerator):
# else break the entity according to rule
else:
self.breakEntity(entity, entityBuffer, entityStation,
totalAvailableCapacity, totalRequestedCapacity)
if self.breakEntity(entity, entityBuffer, entityStation,
totalAvailableCapacity, totalRequestedCapacity):
# reduce the available space if there is need to
if entityBuffer.requireFullProject and \
(not self.checkIfProjectConsumesAssemblySpace(entity, entityBuffer)):
......@@ -386,6 +386,10 @@ class CapacityStationController(EventGenerator):
# calculate what is the capacity that should proceed and what that should remain
capacityToMove=totalAvailableCapacity*(entity.requiredCapacity)/float(totalRequestedCapacity)
capacityToStay=entity.requiredCapacity-capacityToMove
# if capacityToMove is equal to 0 no need to break. Return false.
if capacityToMove==0:
return False
else:
# remove the capacity entity by the buffer so that the broken ones are created
buffer.getActiveObjectQueue().remove(entity)
entityToMoveName=entity.capacityProjectId+'_'+station.objName+'_'+str(capacityToMove)
......@@ -399,6 +403,7 @@ class CapacityStationController(EventGenerator):
entityToStay.currentStation=buffer
import dream.simulation.Globals as Globals
Globals.setWIP([entityToMove,entityToStay]) #set the new components as wip
return True
# merges the capacity entities if they belong to the same project
def mergeEntities(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