[Erp5-report] r44345 leonardo - /erp5/trunk/products/ERP5/Document/UnifySolver.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 16 14:17:35 CET 2011


Author: leonardo
Date: Wed Mar 16 14:17:35 2011
New Revision: 44345

URL: http://svn.erp5.org?rev=44345&view=rev
Log:
fix UnifySolver to correct the divergence where the variable is actually defined

Modified:
    erp5/trunk/products/ERP5/Document/UnifySolver.py

Modified: erp5/trunk/products/ERP5/Document/UnifySolver.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/UnifySolver.py?rev=44345&r1=44344&r2=44345&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/UnifySolver.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/UnifySolver.py [utf8] Wed Mar 16 14:17:35 2011
@@ -72,6 +72,18 @@ class UnifySolver(AcceptSolver):
       delivery_dict.setdefault(simulation_movement.getDeliveryValue(),
                                []).append(simulation_movement)
     for movement, simulation_movement_list in delivery_dict.iteritems():
+      # the movement might not be the right place to correct the
+      # divergence, so we have to find the right place.
+      root_delivery = movement.getRootDeliveryValue()
+      while (movement != root_delivery and
+             not movement.hasProperty(solved_property)):
+        movement = movement.getParentValue()
+      # NOTE: the code above was copied and adapted from the top of
+      # "SolverTool.getSolverDecisionApplicationValueList()", because
+      # we don't have enough info (a divergence tester) to invoke it
+      # from here, and also because a Solver instance needs to be
+      # independent from the divergence testers that caused it, as it
+      # could be the consolidated result of many divergence testers.
       if activate_kw is not None:
         movement.setDefaultActivateParameters(
           activate_kw=activate_kw, **activate_kw)



More information about the Erp5-report mailing list