Class ObjectiveStrategy


  • public class ObjectiveStrategy
    extends AbstractStrategy<IntVar>
    Class that defines a branching strategy over the objective variable
    Since:
    Oct. 2012
    Author:
    Jean-Guillaume Fages
    • Constructor Detail

      • ObjectiveStrategy

        public ObjectiveStrategy​(IntVar objective,
                                 OptimizationPolicy policy)
        Defines a branching strategy over the objective variable BEWARE: only activated after a first solution
        Parameters:
        objective - variable
        policy - BOTTOM_UP, TOP_TOWN or DICHOTOMIC
      • ObjectiveStrategy

        public ObjectiveStrategy​(IntVar objective,
                                 int[] coefs,
                                 OptimizationPolicy policy)
        Defines a parametrized dichotomic branching over the objective variable BEWARE: only activated after a first solution
        Parameters:
        objective - variable
        coefs - [a,b] defines how to split the domain of the objective variable [1,1] will halve its domain [1,2] will take a value closer to the upper bound than the lower bound
        policy - should be DICHOTOMIC
    • Method Detail

      • init

        public boolean init()
        Description copied from class: AbstractStrategy
        Prepare this to be used in a search loop The initialization can detect inconsistency, in that case, it returns false
        Overrides:
        init in class AbstractStrategy<IntVar>