Class IndomainDefaultValue<T extends Var>

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

public class IndomainDefaultValue<T extends Var> extends 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.9
  • 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,Integer>
    It defines for each variable and a value which should be used.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndomainDefaultValue(Map<T,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

    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.
    • defValue

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

    • IndomainDefaultValue

      public IndomainDefaultValue(Map<T,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 Details

    • 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.