Commit 026da3ff authored by Nicolas Dumazet's avatar Nicolas Dumazet

To compute a movement buildability, we only examine nodes that are

ancestors or descendants of said movement.

Instead of computing a closure of a set of nodes, and in a second step
filter nodes to only match those "related" to self, it's better to
compute directly a smaller closure, only consisting of [self]

That's about 3-4 times faster.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36587 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2db41b1d
......@@ -567,13 +567,7 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
# first one, can be built
return True
portal_catalog = self.getPortalObject().portal_catalog
delivery_simulation_movement_list = portal_catalog(
delivery_uid=[x.getUid() for x in explanation_value.getMovementList()])
simulation_movement_list = business_path.getBusinessPathClosure(
delivery_simulation_movement_list)
simulation_movement_list = business_path.getBusinessPathClosure([self])
# store a causality -> causality_related_movement_list mapping
causality_dict = dict()
......@@ -587,14 +581,12 @@ class SimulationMovement(Movement, PropertyRecordableMixin):
completed_state_list = parent_path.getCompletedStateList()
for business_path_movement in related_simulation_list:
if parent_path.isMovementRelatedWithMovement(self,
business_path_movement):
business_path_movement_delivery = business_path_movement \
.getDeliveryValue()
if business_path_movement_delivery is None:
return False # related movement is not delivered yet
if business_path_movement.getSimulationState() not in completed_state_list:
return False
business_path_movement_delivery = business_path_movement \
.getDeliveryValue()
if business_path_movement_delivery is None:
return False # related movement is not delivered yet
if business_path_movement.getSimulationState() not in completed_state_list:
return False
return True
def getSolverProcessValueList(self, movement=None, validation_state=None):
......
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