choco-solver
choco-solver copied to clipboard
[proposal] Heuristic interface to light parrallel solve call
trafficstars
The goal is to
- reduce the code required to make parallel search
- objectify the Strategy management, thus giving more visibility on the creation of strategies.
My proposal :
- a functional interface Heuristic, basically a Function<T extends Model, AbstractStrategy<?>> generating an AbstractStrategy from a Model.
- a new method in IResolutionHelper, namely <T extends Model> Solution findOptimalParallel(IntVar objective, boolean maximize, Function<T, T> modelDuplicator, Criterion stop, Heuristic... heuristics). This method creates a portfolio, iterate over the heuristics, uses the duplicator to duplicate the objective's model past first heuristic, configure this model with corresponding heuristics, then launches the search.
https://github.com/chocoteam/choco-solver/pull/435
no test yet though.