Commit e18af60c authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

AcceptSolver: Update property value with decision_value from DivergenceMessage

parent 566f84c7
...@@ -56,19 +56,12 @@ class AcceptSolver(ConfigurablePropertySolverMixin): ...@@ -56,19 +56,12 @@ class AcceptSolver(ConfigurablePropertySolverMixin):
for simulation_movement in self.getDeliveryValueList(): for simulation_movement in self.getDeliveryValueList():
movement = simulation_movement.getDeliveryValue() movement = simulation_movement.getDeliveryValue()
value_dict = {} value_dict = {}
base_category_set = set(movement.getBaseCategoryList()) divergence_list = movement.getDivergenceList()
for solved_property in solved_property_list: for divergence in divergence_list:
if solved_property in base_category_set: solved_property = divergence.getProperty('tested_property')
# XXX-Leo: Hack, the accept solver was 'accepting' only the first if solved_property not in solved_property_list:
# value of a category and discarding all others by using only continue
# movement.getProperty(). new_value = divergence.getProperty('decision_value')
# A proper fix would perhaps be to use .getPropertyList() always
# (and use .setPropertyList()), but we need to do property
# mapping on simulation and there is no
# simulation_movement.setMappedPropertyList().
new_value = movement.getPropertyList(solved_property)
else:
new_value = movement.getProperty(solved_property)
# XXX hard coded # XXX hard coded
if solved_property == 'quantity': if solved_property == 'quantity':
new_value *= simulation_movement.getDeliveryRatio() new_value *= simulation_movement.getDeliveryRatio()
......
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