Settings object is attached to each
It declares default behavior for various purposes: from general purpose (such as the welcome message), modelling purpose (such as enabling views) or solving purpose (such as the search binder).
The API is:
- Return the welcome message.
- Define how to react when a propagator is not ensured to be idempotent.
- Set to ‘true’ to allow the creation of views in the
VariableFactory. Creates new variables with channeling constraints otherwise.
- Define the maximum domain size threshold to force integer variable to be enumerated instead of bounded while calling
VariableFactory#integer(String, int, int, Solver).
- Set to true to replace intension constraints by extension constraints.
- Define the maximum domain size threshold to replace intension constraints by extension constraints. Only checked when
enableTableSubstitution()is set to true.
- Set to true to plug explanation engine in.
- Set to true to add propagators in explanations
- Define the rounding precision for 51_icstr_mcreg. MUST BE < 13 as java messes up the precisions starting from 10E-12 (34.0*0.05 == 1.70000000000005).
- Defines the smallest used double for 51_icstr_mcreg.
- Defines, for fine events, for each priority, the queue in which a propagator of such a priority should be scheduled in.
- Defines, for coarse events, for each priority, the queue in which a propagator of such a priority should be scheduled in
- Return the default 31_searchbinder.
- Return the condition to satisfy when rebuilding history of backtrackable objects is needed.
- Return true if one wants to be informed of warnings detected during modeling/solving (default value is false).
boolean enableIncrementalityOnBoolSum(int nbvars)
- Return true if the incrementality is enabled on boolean sum, based on the number of variables involved. Default condition is : nbvars > 10.
- If your terminal support ANSI colors (Windows terminals don’t), you can set this to true and decisions and solutions will be output with colors.
- When this setting returns true, a complete trace of the events is output. This can be quite big, though, and it slows down the overall process.
- If this setting is set to true (default value), a clone of the input variable array is made in any propagator constructors. This prevents, for instance, wrong behavior when permutations occurred on the input array (e.g., sorting variables). Setting this to false may limit the memory consumption during modelling.
Extensions of Choco¶
choco-parsers is an extension of Choco 4. It provides a parser for the FlatZinc language, a low-level solver input language that is the target language for MiniZinc. This module follows the flatzinc standards that are used for the annual MiniZinc challenge. It only supports integer variables. You will find it at https://github.com/chocoteam/choco-parsers
choco-graph is a Choco 4 module which allows to search for a graph, which may be subject to graph constraints. The domain of a graph variable G is a graph interval in the form [G_lb,G_ub]. G_lb is the graph representing vertices and edges which must belong to any single solution whereas G_ub is the graph representing vertices and edges which may belong to one solution. Therefore, any value G_v must satisfy the graph inclusion “G_lb subgraph of G_v subgraph of G_ub”. One may see a strong connection with set variables. A graph variable can be subject to graph constraints to ensure global graph properties (e.g. connectedness, acyclicity) and channeling constraints to link the graph variable with some other binary, integer or set variables. The solving process consists of removing nodes and edges from G_ub and adding some others to G_lb until having G_lb = G_ub, i.e. until G gets instantiated. These operations stem from both constraint propagation and search. The benefits of graph variables stem from modeling convenience and performance.
This extension has documentation. You will find it at https://github.com/chocoteam/choco-graph
To manage continuous constraints with Choco, an interface with Ibex has been done. It needs Ibex to be installed on your system.
“IBEX is a C++ library for constraint processing over real numbers.
It provides reliable algorithms for handling non-linear constraints. In particular, round off errors are also taken into account. It is based on interval arithmetic and affine arithmetic.” – http://www.ibex-lib.org/
See the installation instructions of Ibex to complied Ibex on your system.
More specially, take a look at Installation as a dynamic library
Do not forget to add the
--with-java-package=org.chocosolver.solver.constraints.real configuration option.
Once the installation is completed, the JVM needs to know where Ibex is installed to fully benefit from the Choco-Ibex bridge and declare real variables and constraints.
This can be done either with an environment variable of by adding
-Djava.library.path=path/to/ibex/lib to the JVM arguments.
The path /path/to/ibex/lib points to the lib directory of the Ibex installation directory.