public void execute() { for (int i = 0; i < size(); ++i) { Constraint c = (Constraint)constraintAt(i); c.execute(); } }
// The given variable has changed. Propagate new values downstream. public void propagateFrom(Variable v) { ArrayList todo = new ArrayList(); addConstraintsConsumingTo(v, todo); while (!(todo.Count == 0)) { #if USE_STACK Constraint c = (Constraint)todo[todo.Count - 1]; todo.RemoveAt(0); #else Constraint c = (Constraint)todo[todo.Count - 1]; todo.RemoveAt(0); #endif c.execute(); addConstraintsConsumingTo(c.output(), todo); } }