DragonBreath An Optimization Engine based on Constraint Programming and Local Search |
[HOMEPAGE] -> [Documentation] -> [Interfaces to the Engine] -> [Java] -> [Satisfaction/Optimization]
As a default, the constraints' improvement heuristics may also change the constraint graph itself, e.g., deleting some unwanted variables. To enable or disable this behavior, the following member functions of the related GlobalSearchControl object can be used:
void enableStructuralChanges(); void disableStructuralChanges();
For example, a restriction to the behavior of conventional constraint solvers can be forced for a GlobalSearchControl object gsc by:
gsc.disableStructuralChanges();
One improvement iteration is executed by the GlobalSearchControl object's following member function:
boolean improveSolution();
The function returns false if all constraints are already satisfied/optimized.
The following code snippet optimizes the cost functions of a GlobalSearchControl object gsc until all constraints are satisfied/optimized or a maximum of 1,000 iterations has been reached:
int iteration = 0;
while ((iteration++ < 1000) && gsc.improveSolution()) {
System.out.println("After iteration " + iteration + ":\n");
System.out.println(gsc.getCostFunctionInfo());
}
[HOMEPAGE] -> [Documentation] -> [Interfaces to the Engine] -> [Java] -> [Satisfaction/Optimization]
For questions, comments or suggestions, please visit our feedback forum.
Last update:
September 3, 2002 by Alexander Nareyek