Cream.DefaultSolver.Satisfy C# (CSharp) Method

Satisfy() protected method

The Satisfy process will get rid of the domains items that are satisfied with the constraints
protected Satisfy ( ) : bool
return bool
        protected internal virtual bool Satisfy()
        {
            while (!Aborted)
            {
                var hardConstraints = ModifiedConstraints().Cast<Constraint>().Where(cons => cons.CType == ConstraintTypes.Hard);
                if (hardConstraints.Any(c => !c.Satisfy(trail)))
                {
                    return false; // hard constraint broken track back
                }

                if (network.Variables.Cast<Variable>().Where(vars => vars.IsModified()).Count() == 0)
                {
                    // all constraints are satisfied and no more modified variables
                    break;
                }

            }
            return true;
        }