src/Kingdom.OrTools.Sat.Core/OrProblemSolverBase.cs
/// <summary>
/// Prepares the <see cref="CpSolver"/>. Indirectly also prepares the
/// <see cref="CpModel"/>, which is really the focus of the Sat based approach.
/// </summary>
/// <returns></returns>
Prepares the . Indirectly also prepares the
, which is really the focus of the Sat based approach.
Prepares the . Indirectly also prepares the which is really the focus of the Sat based approach .
protected virtual Tuple<CpSolver, CpModel> PrepareProblemSolver()
        {
            IEnumerable<CpSolver> GetDefaultSolver(string stringParameters)
            {
                stringParameters = stringParameters?.Trim() ?? Empty;
                if (!IsNullOrEmpty(stringParameters))
                {
                    yield return new CpSolver {StringParameters = stringParameters};
                }
            }
            Solver = GetDefaultSolver(ParametersString).SingleOrDefault() ?? new CpSolver();
            var variables = Variables.ToList();
            var intervals = Intervals.ToList();
            var constraints = Constraints.ToArray();
            return Tuple.Create(Solver, Source);
        }
protected virtual Tuple < CpSolver , CpModel > PrepareProblemSolver ( ) { IEnumerable < CpSolver > GetDefaultSolver ( string stringParameters ) { stringParameters = stringParameters ? . Trim ( ) ?? Empty ; if ( ! IsNullOrEmpty ( stringParameters ) ) { yield return new CpSolver { StringParameters = stringParameters } ; } } Solver = GetDefaultSolver ( ParametersString ) . SingleOrDefault ( ) ?? new CpSolver ( ) ; var variables = Variables . ToList ( ) ; var intervals = Intervals . ToList ( ) ; var constraints = Constraints . ToArray ( ) ; return Tuple . Create ( Solver , Source ) ; }
Prepares the .
Prepares the .
// Only relay the StringParameters when we actually have them. /* Truly there is nothing to convey to any Monitors, Search Agents, etc, for the Sat
             * approach. Once they are New created or Added, they are registered with the Model
             * forever and ever AMEN. */ // ReSharper disable once UnusedVariable // ReSharper disable once UnusedVariable // ReSharper disable once UnusedVariable // TODO: TBD: any other aspects of Solver/Model that need to be obtained?
None