private ISolver GetSolver(ISolver solver, AbstractSolverBuilder builder)
 {
     if (!IsNecessaryToCreateSolver(solver, builder)) return solver;
     if (_storageChanged[builder]) builder.SetGraph(_storage.GetNodeCollection());
     if (solver != null) solver.Solved -= OnSolved;
     solver = builder.GetResult();
     solver.Solved += OnSolved;
     _storageChanged[builder] = false;
     _optionsChanged[builder] = false;
     return solver;
 }
Exemplo n.º 2
0
 private ISolver GetSolver(ISolver solver, AbstractSolverBuilder builder)
 {
     if (!IsNecessaryToCreateSolver(solver, builder))
     {
         return(solver);
     }
     if (_storageChanged[builder])
     {
         builder.SetGraph(_storage.GetNodeCollection());
     }
     if (solver != null)
     {
         solver.Solved -= OnSolved;
     }
     solver                   = builder.GetResult();
     solver.Solved           += OnSolved;
     _storageChanged[builder] = false;
     _optionsChanged[builder] = false;
     return(solver);
 }
Exemplo n.º 3
0
 private bool IsNecessaryToCreateSolver(ISolver solver, AbstractSolverBuilder builder)
 {
     return(solver == null || _optionsChanged[builder] || _storageChanged[builder]);
 }
 private bool IsNecessaryToCreateSolver(ISolver solver, AbstractSolverBuilder builder)
 {
     return solver == null || _optionsChanged[builder] || _storageChanged[builder];
 }