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;
}