src/Kingdom.OrTools.ConstraintSolver.Core/Internal/SearchAgent.cs
/// <summary>
/// Performs the Search given the <paramref name="solver"/>.
/// </summary>
/// <param name="solver"></param>
/// <returns></returns>
Performs the Search given the .
Performs the Search given the .
private Solver PerformSearch(Solver solver)
        {
            var collection = new ReadOnlyAssignmentCollection(Collector);
            var variables = Variables.ToArray();
            while (solver?.NextSolution() == true)
            {
                if (OnPredicated().ShouldBreak) break;
                if (OnNextAssignment(collection).ShouldBreak) break;
                if (OnProcessVariables(variables).ShouldBreak) break;
            }
            return solver;
        }
private Solver PerformSearch ( Solver solver ) { var collection = new ReadOnlyAssignmentCollection ( Collector ) ; var variables = Variables . ToArray ( ) ; while ( solver ? . NextSolution ( ) == true ) { if ( OnPredicated ( ) . ShouldBreak ) break ; if ( OnNextAssignment ( collection ) . ShouldBreak ) break ; if ( OnProcessVariables ( variables ) . ShouldBreak ) break ; } return solver ; }
Performs the Search given the .
Performs the Search given the .
// TODO: TBD: depending on the kind of collector, first, last, all, etc, may want to rethink this approach a bit... // TODO: TBD: particularly in how/when we process the assignments/variables... // Evaluate Variables as an Array once. // The Solver should be set but let's double check that just in case. // TODO: TBD: the only thing I don't like about this is the overhead involved maintaining events/handlers/args, etc
None
solver
Solver
None