choco.kernel.solver
Class Configuration

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by choco.kernel.solver.Configuration
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
Direct Known Subclasses:
LNSCPConfiguration, PreProcessConfiguration

public class Configuration
extends Properties

User : cprudhom
Mail : cprudhom(a)emn.fr
Date : 21 avr. 2010br/> Since : Choco 2.1.1

See Also:
Serialized Form

Nested Class Summary
static interface Configuration.Default
          Annotation to define a default value for a field.
 
Field Summary
static String BOTTOM_UP
          
Goal: Apply a bottom-up search algorithm (optimization).
static String CARD_REASONNING
          
Goal: Enable card reasonning: decide if redundant constraints are automatically added to the model to reason on cardinalities on sets as well as kernel and enveloppe.
static String CEQ_ORDER
          
Goal: constraint priority order for propagation engine
Type: int
Default value: 1234567 *
Restriction: |CEQ_ORDER| = 7, CEQ_ORDER = {1,2,3,4,5,6,7}
static String HORIZON_UPPER_BOUND
          
Goal:
Type: int
Default value: 21474836 (choco.Choco.MAX_UPPER_BOUND)
static String INIT_DESTRUCTIVE_LOWER_BOUND
          
Goal: Compute a destructive lower bound before starting the search (optimization).
static String INIT_DLB_SHAVING
          
Goal: Apply shaving while computing the destructive lower bound.
static String INIT_SHAVE_ONLY_DECISIONS
          
Goal: perform shaving only on decision vars.
static String INIT_SHAVING
          
Goal: Enforce the use of shaving before starting the search.
static String NOGOOD_RECORDING_FROM_RESTART
          
Goal: Enable nogood recording from restart.
static String RANDOM_SEED
          
Goal: Initial seed to generate streams of pseudorandom numbers
Type: int
Default value: 0
static String RATION_HOLE
          
Goal: The ratio of holes within domains to which decision are performed to switch from BC to AC
Type: double
Default value: 0.7f
static String REAL_PRECISION
          
Goal: Precision of the search for problem involving real variables
Type: double
Default value: 1.0e-6
static String REAL_REDUCTION
          
Goal: Minimal width reduction between two propagations, for problem involving real variables
Type: double
Default value: 0.99
static String RECOMPUTATION_GAP
          
Goal: Tells the strategy wether or not use recomputation.
static String RESOLUTION_POLICY
          
Goal: Resolution policy: satisfaction or optimization (minimization or maximization).
static String RESTART_AFTER_SOLUTION
          
Goal: do restart from root node after each solution.
static String RESTART_BASE
          
Goal: initial number of fails limiting the first search.
static String RESTART_GEOM_GROW
          
Goal: geometrical factor for restart strategy
Type: double
Default value: 1.2
static String RESTART_GEOMETRICAL
          
Goal: To enable geometrical restart.
static String RESTART_LIMIT
          
Goal: Restart limit type.
static String RESTART_LIMIT_BOUND
          
Goal: Restart limit bound.
static String RESTART_LUBY
          
Goal: To enable luby restart.
static String RESTART_LUBY_GROW
          
Goal: geometrical factor for restart strategy
Type: int
Default value: 2
static String RESTART_POLICY_LIMIT
          
Goal: Restart Policy limit type.
static String RESTORE_BEST_SOLUTION
          
Goal:
Type: boolean
Default value: true
static String SEARCH_LIMIT
          
Goal: Search limit type.
static String SEARCH_LIMIT_BOUND
          
Goal: Search limit bound.
static String SOLUTION_POOL_CAPACITY
          
Goal: Solution pool capacity, number of solutions to store within the solutions' pool.
static String STOP_AT_FIRST_SOLUTION
          
Goal: Search for all solutions of a problem.
protected static String VALUE_FALSE
           
protected static String VALUE_OFF
           
protected static String VALUE_TRUE
           
static String VEQ_ORDER
          
Goal: variable priority order for propagation engine
Type: int
Default value: 1234567
Restriction: |VEQ_ORDER| = 7, VEQ_ORDER = {1,2,3,4,5,6,7}
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
Configuration()
          Creates an empty property list with loaded default values.
Configuration(Properties defaults)
          Creates an empty property list with the specified defaults.
 
Method Summary
 String loadDefault(String key)
          Load the default value of keys defined in @Default annotation
 void putBoolean(String key, boolean value)
          Maps the specified key to the specified value in this hashtable.
 void putDouble(String key, double value)
          Maps the specified key to the specified value in this hashtable.
 void putEnum(String key, Enum value)
          Maps the specified key to the specified value in this hashtable.
 void putFalse(String key)
           
 void putFile(String key, File value)
          Maps the specified key to the specified value in this hashtable.
 void putInt(String key, int value)
          Maps the specified key to the specified value in this hashtable.
 void putLong(String key, long value)
          Maps the specified key to the specified value in this hashtable.
 void putTrue(String key)
           
 boolean readBoolean(String key)
          Returns the value to which the specified key is mapped.
 boolean readBoolean(String key, boolean defaultValue)
          Returns the value to which the specified key is mapped, if exists.
 double readDouble(String key)
          Returns the value to which the specified key is mapped.
 double readDouble(String key, double defaultValue)
          Returns the value to which the specified key is mapped, if exists.
<T extends Enum<T>>
T
readEnum(String key, Class clazz)
          Returns the value to which the specified key is mapped.
<T extends Enum<T>>
T
readEnum(String key, T defaultValue)
          Returns the value to which the specified key is mapped, if exists.
 File readFile(String key)
          Returns the value to which the specified key is mapped.
 File readFile(String key, File defaultValue)
          Returns the value to which the specified key is mapped, if exists.
 int readInt(String key)
          Returns the value to which the specified key is mapped.
 int readInt(String key, int defaultValue)
          Returns the value to which the specified key is mapped, if exists.
 long readLong(String key)
          Returns the value to which the specified key is mapped.
 long readLong(String key, long defaultValue)
          Returns the value to which the specified key is mapped, if exists.
 String readString(String key)
          Returns the value to which the specified key is mapped.
 String readString(String key, String defaultValue)
          Returns the value to which the specified key is mapped, if exists.
 void setDefault()
          Set default configuration.
 void storeDefault(File file, String comments)
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE_TRUE

protected static final String VALUE_TRUE
See Also:
Constant Field Values

VALUE_FALSE

protected static final String VALUE_FALSE
See Also:
Constant Field Values

VALUE_OFF

protected static final String VALUE_OFF
See Also:
Constant Field Values

STOP_AT_FIRST_SOLUTION

public static final String STOP_AT_FIRST_SOLUTION

Goal: Search for all solutions of a problem.
Type: boolean
Default value: true

See Also:
Constant Field Values

RESOLUTION_POLICY

public static final String RESOLUTION_POLICY

Goal: Resolution policy: satisfaction or optimization (minimization or maximization).
Type: ResolutionPolicy
Default value: SATISFACTION

See Also:
Constant Field Values

RESTART_AFTER_SOLUTION

public static final String RESTART_AFTER_SOLUTION

Goal: do restart from root node after each solution.
Type: boolean
Default value: false

See Also:
Constant Field Values

RESTART_LUBY

public static final String RESTART_LUBY

Goal: To enable luby restart.
Type: boolean
Default value: false

See Also:
Constant Field Values

RESTART_GEOMETRICAL

public static final String RESTART_GEOMETRICAL

Goal: To enable geometrical restart.
Type: boolean
Default value: false

See Also:
Constant Field Values

RESTART_BASE

public static final String RESTART_BASE

Goal: initial number of fails limiting the first search.
Type: int
Default value: 512

See Also:
Constant Field Values

RESTART_LUBY_GROW

public static final String RESTART_LUBY_GROW

Goal: geometrical factor for restart strategy
Type: int
Default value: 2

See Also:
Constant Field Values

RESTART_GEOM_GROW

public static final String RESTART_GEOM_GROW

Goal: geometrical factor for restart strategy
Type: double
Default value: 1.2

See Also:
Constant Field Values

RESTART_POLICY_LIMIT

public static final String RESTART_POLICY_LIMIT

Goal: Restart Policy limit type. If the limit bound defined by the policy (Luby, Geom) is reached, the search is restarted.
Type: Limit
Default value: BACKTRACK

See Also:
Constant Field Values

NOGOOD_RECORDING_FROM_RESTART

public static final String NOGOOD_RECORDING_FROM_RESTART

Goal: Enable nogood recording from restart.
Type: boolean
@see Nogood Recording from Restarts. Lecoutre, C.; Sais, L.; Tabary, S. & Vidal,
IJCAI 2007 Proceedings of the 20th International Joint Conference on Artificial Intelligence, Hyderabad, India, January 6-12, 2007, 2007, 131-136
Default value: false

See Also:
Constant Field Values

RECOMPUTATION_GAP

public static final String RECOMPUTATION_GAP

Goal: Tells the strategy wether or not use recomputation. The value of the parameter indicates the maximum recomputation gap, i.e. the maximum number of decisions between two storages. If the parameter is lower than or equal to 1, the trailing storage mechanism is used (default).
Type: int
Default value: 1

See Also:
Constant Field Values

CARD_REASONNING

public static final String CARD_REASONNING

Goal: Enable card reasonning: decide if redundant constraints are automatically added to the model to reason on cardinalities on sets as well as kernel and enveloppe.
Type: boolean
Default value: true

See Also:
Constant Field Values

RANDOM_SEED

public static final String RANDOM_SEED

Goal: Initial seed to generate streams of pseudorandom numbers
Type: int
Default value: 0

See Also:
Constant Field Values

SEARCH_LIMIT

public static final String SEARCH_LIMIT

Goal: Search limit type. If the search has not ended in the define limit bound, it is automatically stopped.
Type: Limit
Default value: UNDEF

See Also:
Constant Field Values

SEARCH_LIMIT_BOUND

public static final String SEARCH_LIMIT_BOUND

Goal: Search limit bound. If the search has not ended in the define search limit bound, it is automatically stopped.
Type: int
Default value: 2147483647 (Integer.MAX_VALUE)

See Also:
Constant Field Values

RESTART_LIMIT

public static final String RESTART_LIMIT

Goal: Restart limit type. If the limit bound is reached, the search stops restarting.
Type: Limit
Default value: UNDEF

See Also:
Constant Field Values

RESTART_LIMIT_BOUND

public static final String RESTART_LIMIT_BOUND

Goal: Restart limit bound. If the limit bound is reached, the search stops restarting. it is automatically stopped.
Type: int
Default value: 2147483647 (Integer.MAX_VALUE)

See Also:
Constant Field Values

INIT_SHAVING

public static final String INIT_SHAVING

Goal: Enforce the use of shaving before starting the search.
The shaving mechanism is related to singloton consistency.
Type: boolean
Default value: false

See Also:
Constant Field Values

INIT_DESTRUCTIVE_LOWER_BOUND

public static final String INIT_DESTRUCTIVE_LOWER_BOUND

Goal: Compute a destructive lower bound before starting the search (optimization).
Type: boolean
Default value: false

See Also:
Constant Field Values

INIT_DLB_SHAVING

public static final String INIT_DLB_SHAVING

Goal: Apply shaving while computing the destructive lower bound.
For each hypothetical upper bound, the consistency test applies shaving.
Type: boolean
Default value: false

See Also:
Constant Field Values

INIT_SHAVE_ONLY_DECISIONS

public static final String INIT_SHAVE_ONLY_DECISIONS

Goal: perform shaving only on decision vars.
Type: boolean
Default value: true

See Also:
Constant Field Values

BOTTOM_UP

public static final String BOTTOM_UP

Goal: Apply a bottom-up search algorithm (optimization).
The top-down strategy (default) starts with a upper bound and tries to improve it.
The bottom-up starts with a lower bound as target upper bound which is incremented by one unit until the problem becomes feasible..
Type: boolean
Default value: false

See Also:
Constant Field Values

HORIZON_UPPER_BOUND

public static final String HORIZON_UPPER_BOUND

Goal:
Type: int
Default value: 21474836 (choco.Choco.MAX_UPPER_BOUND)

See Also:
Constant Field Values

SOLUTION_POOL_CAPACITY

public static final String SOLUTION_POOL_CAPACITY

Goal: Solution pool capacity, number of solutions to store within the solutions' pool.
Type: int
Default value: 1

See Also:
Constant Field Values

RESTORE_BEST_SOLUTION

public static final String RESTORE_BEST_SOLUTION

Goal:
Type: boolean
Default value: true

See Also:
Constant Field Values

REAL_PRECISION

public static final String REAL_PRECISION

Goal: Precision of the search for problem involving real variables
Type: double
Default value: 1.0e-6

See Also:
Constant Field Values

REAL_REDUCTION

public static final String REAL_REDUCTION

Goal: Minimal width reduction between two propagations, for problem involving real variables
Type: double
Default value: 0.99

See Also:
Constant Field Values

RATION_HOLE

public static final String RATION_HOLE

Goal: The ratio of holes within domains to which decision are performed to switch from BC to AC
Type: double
Default value: 0.7f

See Also:
Constant Field Values

VEQ_ORDER

public static final String VEQ_ORDER

Goal: variable priority order for propagation engine
Type: int
Default value: 1234567
Restriction: |VEQ_ORDER| = 7, VEQ_ORDER = {1,2,3,4,5,6,7}

See Also:
Constant Field Values

CEQ_ORDER

public static final String CEQ_ORDER

Goal: constraint priority order for propagation engine
Type: int
Default value: 1234567 *
Restriction: |CEQ_ORDER| = 7, CEQ_ORDER = {1,2,3,4,5,6,7}

See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration()
Creates an empty property list with loaded default values.


Configuration

public Configuration(Properties defaults)
Creates an empty property list with the specified defaults.

Parameters:
defaults - the defaults.
Method Detail

setDefault

public void setDefault()
Set default configuration. First clear then load default values for defined keys.


loadDefault

public String loadDefault(String key)
Load the default value of keys defined in @Default annotation

Throws:
IllegalAccessException - if the specified object is not an instance of the class or interface declaring the underlying

readBoolean

public boolean readBoolean(String key)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as a boolean.

readBoolean

public boolean readBoolean(String key,
                           boolean defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as an integer.

readInt

public int readInt(String key)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as an integer.

readInt

public int readInt(String key,
                   int defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as an integer.

readFile

public File readFile(String key)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null

readFile

public File readFile(String key,
                     File defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null

readLong

public long readLong(String key)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as a long.

readLong

public long readLong(String key,
                     long defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as a long.

readDouble

public double readDouble(String key)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as a double.

readDouble

public double readDouble(String key,
                         double defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as an integer.

readString

public String readString(String key)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as an integer.

readString

public String readString(String key,
                         String defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as an integer.

readEnum

public <T extends Enum<T>> T readEnum(String key,
                                      Class clazz)
Returns the value to which the specified key is mapped.

Parameters:
key - the key whose associated value is to be returned
clazz - the class of the enum expected
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as a boolean.

readEnum

public <T extends Enum<T>> T readEnum(String key,
                                      T defaultValue)
Returns the value to which the specified key is mapped, if exists. Otherwise, return default value.

Parameters:
key - the key whose associated value is to be returned
clazz - the class of the enum expected
defaultValue - value to return the key does not exist in the configuration
Returns:
the value to which the specified key is mapped
Throws:
NullPointerException - if the specified key is null
NumberFormatException - if the value cannot be parsed as a boolean.

putInt

public void putInt(String key,
                   int value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

*

Parameters:
key - the hashtable key
value - the value
Throws:
NullPointerException - if the key or value is null

putLong

public void putLong(String key,
                    long value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

*

Parameters:
key - the hashtable key
value - the value
Throws:
NullPointerException - if the key or value is null

putDouble

public void putDouble(String key,
                      double value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

*

Parameters:
key - the hashtable key
value - the value
Throws:
NullPointerException - if the key or value is null

putTrue

public void putTrue(String key)

putFalse

public void putFalse(String key)

putBoolean

public void putBoolean(String key,
                       boolean value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

*

Parameters:
key - the hashtable key
value - the value
Throws:
NullPointerException - if the key or value is null

putEnum

public void putEnum(String key,
                    Enum value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

*

Parameters:
key - the hashtable key
value - the value
Throws:
NullPointerException - if the key or value is null

putFile

public void putFile(String key,
                    File value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null.

*

Parameters:
key - the hashtable key
value - the value
Throws:
NullPointerException - if the key or value is null

storeDefault

public void storeDefault(File file,
                         String comments)
                  throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.