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 candidate decision variables (IntExpression and IntervalVar).

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

See Also:
  • Method Details

    • collect

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

      public static List<IntExpression> collectAllIntVars(ModelDispatcher model, Objective objective)
      Collects all integer/boolean variables relevant for black-box search on the model, starting with primary decision variables from collect(ModelDispatcher), followed by any leaf IntVar in the objective and any remaining registered IntVar on the ModelDispatcher.
      Parameters:
      model - the model to inspect
      objective - optional objective
      Returns:
      ordered, identity-deduplicated, unmodifiable list of integer variables
    • collectIntervals

      public static List<IntervalVar> collectIntervals(ModelDispatcher model)
      Collects all IntervalVar instances from the model's constraint graph and registered interval variables.
      Parameters:
      model - the model to inspect
      Returns:
      ordered, identity-deduplicated, unmodifiable list of interval variables