Commit 482c2d2b authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

AcceptSolver: Update property value with decision_value from DivergenceMessage

parent 5bbb2fa4
......@@ -57,19 +57,12 @@ class AcceptSolver(ConfigurablePropertySolverMixin):
for simulation_movement in self.getDeliveryValueList():
movement = simulation_movement.getDeliveryValue()
value_dict = {}
base_category_set = set(movement.getBaseCategoryList())
for solved_property in solved_property_list:
if solved_property in base_category_set:
# XXX-Leo: Hack, the accept solver was 'accepting' only the first
# value of a category and discarding all others by using only
# movement.getProperty().
# 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)
divergence_list = movement.getDivergenceList()
for divergence in divergence_list:
solved_property = divergence.getProperty('tested_property')
if solved_property not in solved_property_list:
continue
new_value = divergence.getProperty('decision_value')
# XXX hard coded
if solved_property == 'quantity':
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