Class IndomainHierarchical<T extends Var>

java.lang.Object
org.jacop.search.IndomainHierarchical<T>
Type Parameters:
T - type of variable being used in the search.
All Implemented Interfaces:
Indomain<T>

public class IndomainHierarchical<T extends Var> extends 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>
    It defines the default indomain if there is no mapping provided.
    private Map<T,Indomain<T>>
    It defines for each variable and indomain method which should be used.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndomainHierarchical(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

    Modifier and Type
    Method
    Description
    int
    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 Details

    • defIndomain

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

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

    • IndomainHierarchical

      public IndomainHierarchical(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 Details

    • indomain

      public int indomain(T v) throws 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:
      RuntimeException