Module org.maxicp

Class DecisionVarCollector

java.lang.Object
org.maxicp.modeling.DecisionVarCollector

public class DecisionVarCollector extends Object
Walks the full constraint / expression graph of a ModelDispatcher and collects all candidate decision variables declared by DecisionVarsProvider nodes.

Walk strategy:

  1. For every Constraint: if it implements DecisionVarsProvider, harvest its decisionVariables().
  2. Descend the expression sub-tree of every scope expression via Expression.subexpressions(), collecting from any DecisionVarsProvider node found (e.g. an Element1D embedded inside a sum).

Results are deduplicated by identity, preserving first-seen order.

See Also:
  • Method Details

    • collect

      public static List<IntExpression> collect(ModelDispatcher model)
      Collects all candidate decision variables inferred from the model's constraint graph.
      Parameters:
      model - the model to inspect
      Returns:
      ordered, identity-deduplicated, unmodifiable list of decision variables