Class IndomainDefaultValue<T extends Var>

  • Type Parameters:
    T - type of variable being used in the search.
    All Implemented Interfaces:
    Indomain<T>

    public class IndomainDefaultValue<T extends Var>
    extends java.lang.Object
    implements Indomain<T>
    IndomainDefaultValue - implements enumeration method based on the selection of the default value for each variable first. If selection of this value will not succeed it will try to assign values with the default indomain method.

    This method works only for IntVar.

    Version:
    4.8
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Indomain<T> defIndomain
      It defines the default indomain if there is no mapping provided.
      private java.util.Map<T,​java.lang.Integer> defValue
      It defines for each variable and a value which should be used.
    • Constructor Summary

      Constructors 
      Constructor Description
      IndomainDefaultValue​(java.util.Map<T,​java.lang.Integer> defaultValue, Indomain<T> defaultIndomain)
      Constructor which specifies default values to be used if values are not in the domain a defualt indomain is used.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int indomain​(T v)
      It returns value within a variable which should be used in current assignment.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • defIndomain

        private Indomain<T extends Var> defIndomain
        It defines the default indomain if there is no mapping provided.
      • defValue

        private java.util.Map<T extends Var,​java.lang.Integer> defValue
        It defines for each variable and a value which should be used.
    • Constructor Detail

      • IndomainDefaultValue

        public IndomainDefaultValue​(java.util.Map<T,​java.lang.Integer> defaultValue,
                                    Indomain<T> defaultIndomain)
        Constructor which specifies default values to be used if values are not in the domain a defualt indomain is used.
        Parameters:
        defaultIndomain - default indomain heuristic used.
        defaultValue - default value used for each variable.
    • Method Detail

      • indomain

        public int indomain​(T v)
        Description copied from interface: Indomain
        It returns value within a variable which should be used in current assignment. This function only returns value, it is not required to do any changes to variable, its domain, etc.
        Specified by:
        indomain in interface Indomain<T extends Var>
        Parameters:
        v - defines variable for which value for assignment is suggested.
        Returns:
        defines value for current assignment.