Commit 85d9ac28 authored by Sebastien Robin's avatar Sebastien Robin

allow to define additional parameters


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3955 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12390d0d
...@@ -46,11 +46,14 @@ class TargetSolver: ...@@ -46,11 +46,14 @@ class TargetSolver:
to update parent target to update parent target
""" """
def __init__(self, **kw): def __init__(self, additional_parameters=None,**kw):
""" """
Creates an instance of TargetSolver with parameters Creates an instance of TargetSolver with parameters
""" """
self.__dict__.update(kw) self.__dict__.update(kw)
if additional_parameters is None:
additional_parameters = {}
self.additional_parameters = additional_parameters
self.previous_target = {} self.previous_target = {}
def solve(self, simulation_movement): def solve(self, simulation_movement):
......
...@@ -104,7 +104,7 @@ class SimulationTool (BaseTool): ...@@ -104,7 +104,7 @@ class SimulationTool (BaseTool):
""" show the content in the left pane of the ZMI """ """ show the content in the left pane of the ZMI """
return self.objectValues() return self.objectValues()
def solveDelivery(self, delivery, dsolver_name, tsolver_name, **kw): def solveDelivery(self, delivery, dsolver_name, tsolver_name, additional_parameters=None,**kw):
""" """
Solve a delivery by calling DeliverySolver and TargetSolver Solve a delivery by calling DeliverySolver and TargetSolver
""" """
...@@ -117,7 +117,7 @@ class SimulationTool (BaseTool): ...@@ -117,7 +117,7 @@ class SimulationTool (BaseTool):
__import__(solver_file_path) __import__(solver_file_path)
solver_file = getattr(solver_module, solver_name) solver_file = getattr(solver_module, solver_name)
solver_class = getattr(solver_file, solver_name) solver_class = getattr(solver_file, solver_name)
solver = solver_class(**kw) solver = solver_class(additional_parameters=additional_parameters,**kw)
solver.solveDelivery(delivery) solver.solveDelivery(delivery)
......
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