The basic answer is that you can define an objective function as an IntVar, using the invariant library to express its formula. If you want to be able to evaluate the objective function on neightbors using the partial propagation feature of Asteroid, you can use the Objective class of package objective.core as follows:
Most of the available examples are driven by the conflit reduction
how can we define a more general objective functions (with small snippet) ?
The basic answer is that you can define an objective function as an IntVar, using the invariant library to express its formula. If you want to be able to evaluate the objective function on neightbors using the partial propagation feature of Asteroid, you can use the Objective class of package objective.core as follows:
so that during the ssearch, you can call for instance
More partial propagation queries are available, check the documentation of the Objective class. https://sourceforge.net/p/asteroid/code/28/tree/trunk/Asteroid/src/objective/core/Objective.scala#l32
Of course, the search strategy is up to you, as usual in local search systems.
Last edit: Renaud De Landtsheer 2012-05-22