Class RealStrategy


  • public class RealStrategy
    extends AbstractStrategy<RealVar>
    Define a strategy based on RealVar. It defines how a variable is selected to be part of the next decision, and which value from its domain is selected too. Then, the decision will be var ≤ {value}.
    Since:
    2 juil. 2010
    Author:
    Charles Prud'homme
    • Constructor Detail

      • RealStrategy

        public RealStrategy​(RealVar[] scope,
                            VariableSelector<RealVar> varselector,
                            RealValueSelector valueIterator,
                            double epsilon,
                            boolean leftFirst)
        Create a real strategy which generates decision over real variables.

        A real decision is like:

        • left branch: X ≤ v
        • right branch: X ≥ v + e
        where e is 'epsilon'

        Parameters:
        scope - variables to be managed with this strategy
        varselector - how to select the next variable to branch on
        valueIterator - on to select the value
        epsilon - gap value for refutation
        leftFirst - select left range first
    • 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<RealVar>
      • computeDecision

        public Decision<RealVar> computeDecision​(RealVar variable)
        Description copied from class: AbstractStrategy
        Computes a decision to be applied to variable var This method should be implemented in order to use search patterns
        Overrides:
        computeDecision in class AbstractStrategy<RealVar>
        Parameters:
        variable - a variable
        Returns:
        a decision to be applied to variable var
      • getDecision

        public Decision getDecision()
        Description copied from class: AbstractStrategy
        Provides access to the current decision in the strategy. If there are no more decision to provide, it returns null.
        Specified by:
        getDecision in class AbstractStrategy<RealVar>
        Returns:
        the current decision