Closed KmolYuan closed 3 years ago
The shared state Context type replace the old AlgorithmBase structure.
Context
AlgorithmBase
The Algorithm trait API can be changed to:
Algorithm
fn init(&mut self, ctx: &mut Context) {} fn generation(&mut self, ctx: &mut Context);
And the Solver trait can be changed to a structure Solver<M, F>:
Solver
Solver<M, F>
struct Solver<M, F> where M: Algorithm, F: ObjFunc, { method: M, func: F, }
ea1057c2bb4ed765609c0374f0de7a7503b377df 84b51ed62784a43fe7c8dfdfcc73fa81dd09064b
The shared state
Context
type replace the oldAlgorithmBase
structure.The
Algorithm
trait API can be changed to:And the
Solver
trait can be changed to a structureSolver<M, F>
: