Commit 5757158a authored by Jean-Paul Smets's avatar Jean-Paul Smets

Interface reviewed and unified with other generic interfaces.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30507 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e932dd6
# -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2009 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2009 Nexedi SARL and Contributors. All Rights Reserved.
...@@ -29,97 +30,61 @@ ...@@ -29,97 +30,61 @@
Products.ERP5.interfaces.simulation_movement Products.ERP5.interfaces.simulation_movement
""" """
from zope.interface import Interface from Products.ERP5.interfaces.property_recordable import IPropertyRecordable
from Products.ERP5.interfaces.movement import IMovement
from Products.ERP5.interfaces.divergence_controller import IDivergenceController
from Products.ERP5.interfaces.business_completable import IBusinessCompletable
class ISimulationMovement(Interface): class ISimulationMovement(IMovement, IPropertyRecordable, IDivergenceController, IBusinessCompletable):
"""Simulation Movement interface specification """Simulation Movement interface specification
The SimulationMovement interface introduces the option The ISimulationMovement interface introduces in addition
to define quantity errors between the simulation to IMovement the possibility to record properties by
and the delivered reality. inheriting IPropertyRecordable, and to track rounding
or non linearities of quantity at build time.
In short: parent applied rules use the Movement The main equation to consider is:
API to define quantity. Child applied rules
should use the Delivered API to access appropriate
quantity values which are take into account the
delivery_error.
DeliverySolver either solve divergence by
setting the delivery_error (then no target
solver needed, at least for quantity) or
by changing the quantity (then TargetSolver
is needed to backtrack the quantity).
Equation:
quantity(SM) + delivery_error (SM) = quantity(SM) + delivery_error (SM) =
quantity(DL) * delivery_ratio(SM) quantity(DL) * delivery_ratio(SM)
where SM is a simulation movement and DL a delivery line.
TODO:
1. unclear API remaining
"""
# Delivery API
def getDeliveryRatio():
"""
Returns ratio to apply on the quantity
property of the corresponding delivery
to obtain the current quantity
"""
def getDeliveryError():
"""
Returns correction to make the match
between delivery quantity and simulation
quantity consistent
"""
def getDeliveryQuantity():
"""
Returns quantity which was actually shipped, taking
into account the errors of the simulation fixed by
the delivery
quantity + delivery_error During the expand process, parent applied rules
""" may define the quantity of the simulation movement,
but not the delivery_error.
def getDeliveryConvertedQuantity(): During the build process, delivery_error can be used
"""XXX - unclear to store on the simulation movement amounts related
""" to rounding or to floating point precision errors.
# Divergence API During the expand process, child applied rules
def isConvergent(): use getDeliveryQuantity rather than getQuantity.
"""Tells whether the simulation movement is convergent
or not, with related delivery
"""
def isDivergent(): Solving quantity divergences can thus be obtained either
"""Tells whether the simulation movement is divergent by changing quantity (which then needs to backtracking)
or not, with related delivery or by changing delivert_error (no backtracking needed)
"""
def getDeliveryRatio():
""" """
Returns ratio to apply on the quantity
property of the corresponding delivery
to obtain the current quantity
def getDivergenceList(): NOTE: redundant with Simulation Property Sheet
"""Returns a list of divergences using DivergenceMessage class
""" """
def isFrozen(): def getDeliveryError():
"""Tells whether the simulation movement is frozen.
By default, looks up the related Business Process Path
and tells if the simulation state is part of frozen
states.
Frozen simulation movement cannot be modified by expanding.
""" """
Returns correction to make the match
between delivery quantity and simulation
quantity consistent
def isCompleted(): NOTE: redundant with Simulation Property Sheet
"""Tells whether the simulation movement is completed.
By default, looks up the related Business Process Path
and tells if the simulation state is part of completed
states.
Completed simulation movement allow to move to next step of Business Process
""" """
def isSimulated(): def getDeliveryQuantity():
"""XXX - unclear
""" """
Returns quantity which was actually shipped, taking
into account the errors of the simulation fixed by
the delivery:
quantity + delivery_error
"""
\ No newline at end of file
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