Commit e7afdbd4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* we need to care recorded properties for decision_movement, not prevision_movement in compare().

* no need to care recorded properties in getUpdatablePropertyDict().


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31071 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e880893b
...@@ -65,11 +65,11 @@ class CategoryMembershipDivergenceTester(Predicate, DivergenceTesterMixin): ...@@ -65,11 +65,11 @@ class CategoryMembershipDivergenceTester(Predicate, DivergenceTesterMixin):
list : (prevision_value, decision_value, message, mapping) list : (prevision_value, decision_value, message, mapping)
""" """
tested_property = self.getTestedProperty() tested_property = self.getTestedProperty()
decision_value = decision_movement.getPropertyList(tested_property) if getattr(decision_movement, 'isPropertyRecorded', lambda:False)():
if prevision_movement.isPropertyRecorded(tested_property): decision_value = decision_movement.getRecordedProperty(tested_property)
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else: else:
prevision_value = prevision_movement.getPropertyList(tested_property) decision_value = decision_movement.getPropertyList(tested_property)
prevision_value = prevision_movement.getPropertyList(tested_property)
# XXX do we have configurable parameter for this divergence tester ? # XXX do we have configurable parameter for this divergence tester ?
# like ambiguity... # like ambiguity...
...@@ -90,10 +90,7 @@ class CategoryMembershipDivergenceTester(Predicate, DivergenceTesterMixin): ...@@ -90,10 +90,7 @@ class CategoryMembershipDivergenceTester(Predicate, DivergenceTesterMixin):
decision_movement -- a delivery movement (decision) decision_movement -- a delivery movement (decision)
""" """
tested_property = self.getTestedProperty() tested_property = self.getTestedProperty()
if prevision_movement.isPropertyRecorded(tested_property): prevision_value = prevision_movement.getPropertyList(tested_property)
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else:
prevision_value = prevision_movement.getPropertyList(tested_property)
return {tested_property:prevision_value} return {tested_property:prevision_value}
def accept(self, simulation_movement): def accept(self, simulation_movement):
......
...@@ -67,13 +67,11 @@ class FloatDivergenceTester(Predicate, DivergenceTesterMixin): ...@@ -67,13 +67,11 @@ class FloatDivergenceTester(Predicate, DivergenceTesterMixin):
list : (prevision_value, decision_value, message, mapping) list : (prevision_value, decision_value, message, mapping)
""" """
tested_property = self.getTestedProperty() tested_property = self.getTestedProperty()
decision_value = decision_movement.getProperty(tested_property) if getattr(decision_movement, 'isPropertyRecorded', lambda:False)():
if self.getProperty('delivery_ratio_enabled'): decision_value = decision_movement.getRecordedProperty(tested_property)
decision_value *= prevision_movement.getDeliveryRatio()
if prevision_movement.isPropertyRecorded(tested_property):
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else: else:
prevision_value = prevision_movement.getProperty(tested_property) decision_value = decision_movement.getProperty(tested_property)
prevision_value = prevision_movement.getProperty(tested_property)
delta = decision_value - prevision_value delta = decision_value - prevision_value
# XXX we should use appropriate property sheets and getter methods # XXX we should use appropriate property sheets and getter methods
...@@ -156,10 +154,7 @@ class FloatDivergenceTester(Predicate, DivergenceTesterMixin): ...@@ -156,10 +154,7 @@ class FloatDivergenceTester(Predicate, DivergenceTesterMixin):
decision_movement -- a delivery movement (decision) decision_movement -- a delivery movement (decision)
""" """
tested_property = self.getTestedProperty() tested_property = self.getTestedProperty()
if prevision_movement.isPropertyRecorded(tested_property): prevision_value = prevision_movement.getProperty(tested_property)
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else:
prevision_value = prevision_movement.getProperty(tested_property)
return {tested_property:prevision_value} return {tested_property:prevision_value}
def accept(self, simulation_movement): def accept(self, simulation_movement):
......
...@@ -68,11 +68,11 @@ class StringDivergenceTester(Predicate, DivergenceTesterMixin): ...@@ -68,11 +68,11 @@ class StringDivergenceTester(Predicate, DivergenceTesterMixin):
list : (prevision_value, decision_value, message, mapping) list : (prevision_value, decision_value, message, mapping)
""" """
tested_property = self.getTestedProperty() tested_property = self.getTestedProperty()
decision_value = decision_movement.getProperty(tested_property) if getattr(decision_movement, 'isPropertyRecorded', lambda:False)():
if prevision_movement.isPropertyRecorded(tested_property): decision_value = decision_movement.getRecordedProperty(tested_property)
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else: else:
prevision_value = prevision_movement.getProperty(tested_property) decision_value = decision_movement.getProperty(tested_property)
prevision_value = prevision_movement.getProperty(tested_property)
# XXX do we have configurable parameter for this divergence tester ? # XXX do we have configurable parameter for this divergence tester ?
# like ambiguity... # like ambiguity...
...@@ -93,10 +93,7 @@ class StringDivergenceTester(Predicate, DivergenceTesterMixin): ...@@ -93,10 +93,7 @@ class StringDivergenceTester(Predicate, DivergenceTesterMixin):
decision_movement -- a delivery movement (decision) decision_movement -- a delivery movement (decision)
""" """
tested_property = self.getTestedProperty() tested_property = self.getTestedProperty()
if prevision_movement.isPropertyRecorded(tested_property): prevision_value = prevision_movement.getProperty(tested_property)
prevision_value = prevision_movement.getRecordedProperty(tested_property)
else:
prevision_value = prevision_movement.getProperty(tested_property)
return {tested_property:prevision_value} return {tested_property:prevision_value}
def accept(self, simulation_movement): def accept(self, simulation_movement):
......
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