DragonBreath An Optimization Engine based on Constraint Programming and Local Search |
[HOMEPAGE] -> [Documentation] -> [Interfaces to the Engine] -> [Java] -> [Initialization]
To use the engine by way of Java, at least the following class must be imported:
import com.ai_center.dragonbreath.GlobalSearchControl;
A GlobalSearchControl object serves as so-called engine or solver, to which the whole problem declaration (and dynamic changes) are passed and which provides methods to solve/optimize these problems.
An engine object is created by calling the GlobalSearchControl constructor. The constructor is called with a random seed value to be used for randomized decisions:
GlobalSearchControl GlobalSearchControl(long randomSeed);
Initialization example, setting a random seed of 0:
GlobalSearchControl gsc = new GlobalSearchControl(0);
A cost mapping of type FactorCostMapping is automatically created in this version of the constructor and set as default. The default cost mapping will be used as selected cost mapping as long as no other cost mapping is selected.
If a different default cost mapping is to be provided, the following classes must be imported as well:
import com.ai_center.dragonbreath.Registry; import com.ai_center.dragonbreath.costs.CostMapping;
The following version of the class constructor is called with an additional CostMapping object to become the default cost mapping:
GlobalSearchControl GlobalSearchControl(long randomSeed, CostMapping costMapping);
The CostMapping object for the constructor method can be created by the following method of the Registry class (for available options for the costMappingID parameter, see the section on costs / cost mappings):
CostMapping createCostMapping(int costMappingID);
Initialization example, setting a random seed of 24 and providing a different default cost mapping:
GlobalSearchControl gsc = new GlobalSearchControl(24,
Registry.createCostMapping(Registry.FACTOR_BINARY_COST_MAPPING));
A typical class (let's call it "Sample.java") that is interfacing the engine could look like this:
import com.ai_center.dragonbreath.GlobalSearchControl;
public class Sample {
public static void main(String[] args) {
GlobalSearchControl gsc = new GlobalSearchControl(0);
// Place code for problem declaration/solving here
}
}
[HOMEPAGE] -> [Documentation] -> [Interfaces to the Engine] -> [Java] -> [Initialization]
For questions, comments or suggestions, please visit our feedback forum.
Last update:
August 22, 2002 by Alexander Nareyek