Class IndomainHierarchical<T extends Var>

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

    public class IndomainHierarchical<T extends Var>
    extends java.lang.Object
    implements Indomain<T>
    IndomainHierarchical - implements enumeration method based on the selection of the preferred indomain for each variable. The initial idea of having such functionality was proposed by Ben Weiner.
    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,​Indomain<T>> hashmap
      It defines for each variable and indomain method which should be used.
    • Constructor Summary

      Constructors 
      Constructor Description
      IndomainHierarchical​(java.util.Map<T,​Indomain<T>> hashmap, Indomain<T> defIndomain)
      Constructor which specifies the mapping and default indomain to be used if mapping does not give specific indomain for some variables.
    • 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.
      • hashmap

        private java.util.Map<T extends Var,​Indomain<T extends Var>> hashmap
        It defines for each variable and indomain method which should be used.
    • Constructor Detail

      • IndomainHierarchical

        public IndomainHierarchical​(java.util.Map<T,​Indomain<T>> hashmap,
                                    Indomain<T> defIndomain)
        Constructor which specifies the mapping and default indomain to be used if mapping does not give specific indomain for some variables.
        Parameters:
        hashmap - a mapping from variable to indomain heuristic used.
        defIndomain - default indomain used if hashmap does not contain an entry.
    • Method Detail

      • indomain

        public int indomain​(T v)
                     throws java.lang.RuntimeException
        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.
        Throws:
        java.lang.RuntimeException