Class IntStrategy

  • Direct Known Subclasses:
    FullyRandom

    public class IntStrategy
    extends AbstractStrategy<IntVar>
    Class to perform branching decisions over integer variables
    Since:
    2 juil. 2010
    Author:
    Charles Prud'homme, Jean-Guillaume Fages
    • Field Detail

      • valueSelector

        protected IntValueSelector valueSelector
        How a value is selected
    • Constructor Detail

      • IntStrategy

        public IntStrategy​(IntVar[] scope,
                           VariableSelector<IntVar> varSelector,
                           IntValueSelector valSelector)
        Creates a search strategy which selects a variable X and a value V to perform the decision X = V BEWARE: if the variable domain is not enumerated, the value V should be a domain bound. Otherwise, the decision cannot be negated, and the search may loop infinitely.
        Parameters:
        scope - defines which variables to branch on
        varSelector - defines how to select the next variable to branch on
        valSelector - defines how to select the value involved in the branching decision
      • IntStrategy

        public IntStrategy​(IntVar[] scope,
                           VariableSelector<IntVar> varSelector,
                           IntValueSelector valSelector,
                           DecisionOperator<IntVar> decOperator)
        Creates a search strategy which selects a variable X and a value V to perform the decision X decOperator V This can be X <= V for instance. BEWARE: if the variable domain is not enumerated, and if the operator is either "=" or "!=", then the value V should be a domain bound. Otherwise, the decision cannot be negated, and the search may loop infinitely.
        Parameters:
        scope - defines which variables to branch on
        varSelector - defines how to select the next variable to branch on
        valSelector - defines how to select the value involved in the branching decision
        decOperator - defines what to do in a branching decision