From 5384cc5fd2d51e8218cb4888a003bd2f3816ce3d Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Sat, 7 Nov 2009 09:41:39 +0000 Subject: [PATCH] First version of delivery_solver refactored interface. Names were chosen not to conflict with existing solvers and to show that delivery solvers are about quantity. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30379 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/interfaces/delivery_solver.py | 34 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/product/ERP5/interfaces/delivery_solver.py b/product/ERP5/interfaces/delivery_solver.py index 4427ccaed8..97634996e3 100644 --- a/product/ERP5/interfaces/delivery_solver.py +++ b/product/ERP5/interfaces/delivery_solver.py @@ -30,7 +30,35 @@ from zope.interface import Interface class IDeliverySolver(Interface): - """Solves quantity values between delivery line and related simulation movements""" - # placeholder to define - pass + """Delivery Solver interface specification + This interface must be implemented by all delivery solvers + which are used to solve quantity related divergences in ERP5 simulation. + Delivery solvers are usually built by SolverTool and invoked by target solvers. + + Delivery solvers are initialised with a list of simulation movements + and provide methods (setQuantity, getQuantity) to manipulate the total + quantity of movements. + """ + + def __init__(movement_list): + """ + Initialises the delivery solver. + + movement_list -- a list of simulation movement on which delivery solver operates + """ + + def getTotalQuantity(): + """ + Return the total quantity by summing the quantity of each simulation + movement. + """ + + def setTotalQuantity(quantity): + """ + Sets the total quantity of simulation movements by increasing or reducing + the quantity and ratio of each simulation movement. This method + implements the solver specific algorith (ex. FIFO, LIFO, average, least cost) + + NOTE: is this the right place to update delivery ratio ? + """ \ No newline at end of file -- 2.30.9