UniverseJavaSearchListener class
#include <UniverseJavaSearchListener.hpp>
Contents
The UniverseJavaSearchListener class defines an adapter for an IUniverseSearchListener written in Java (and implementing the JUniverse interface). The listener is run through the Java Native Interface (JNI).
Base classes
- class IUniverseSearchListener
Public static functions
-
static auto of(easyjni::JavaObject listener) -> Universe::
UniverseJavaSearchListener*
Constructors, destructors, conversion operators
- ~UniverseJavaSearchListener() defaulted
Public functions
- auto operator*() -> easyjni::JavaObject
- void start() override
-
void onPositiveDecision(const Universe::
IUniverseVariable& decisionVariable, const Universe:: BigInteger& value) override -
void onNegativeDecision(const Universe::
IUniverseVariable& decisionVariable, const Universe:: BigInteger& value) override -
void onPropagation(const Universe::
IUniverseVariable& variable, const Universe:: BigInteger& value) override -
void onAssignment(const Universe::
IUniverseVariable& variable, const Universe:: BigInteger& value) override -
void onFailedAssignment(const Universe::
IUniverseVariable& variable, const Universe:: BigInteger& value) override -
void onConflict(const Universe::
IUniverseConstraint& constraint, const Universe:: IUniverseVariable& variable) override -
void onLearning(const Universe::
IUniverseConstraint& noGood) override - void onBacktrack(int level) override
-
void onBacktrack(const Universe::
IUniverseVariable& decisionVariable) override -
void onUnassignment(const Universe::
IUniverseVariable& variable) override - void onRestart() override
- void onCleaning() override
-
void onDelete(const Universe::
IUniverseConstraint& noGood) override -
void onSolutionFound(const std::map<Universe::
IUniverseVariable*, Universe:: BigInteger>& solution) override -
void onSolutionFound(const std::map<Universe::
IUniverseVariable*, Universe:: BigInteger>& solution, const Universe:: BigInteger& cost) override -
void end(Universe::
UniverseSolverResult result) override
Function documentation
static Universe:: UniverseJavaSearchListener* Universe:: UniverseJavaSearchListener:: of(easyjni::JavaObject listener)
| Parameters | |
|---|---|
| listener | The existing Java object. |
| Returns | The wrapper for the object. |
Creates a new UniverseJavaSearchListener from an existing Java object that is an instance of IUniverseSearchListener.
Universe:: UniverseJavaSearchListener:: ~UniverseJavaSearchListener() defaulted
Destroys this UniverseJavaSearchListener.
easyjni::JavaObject Universe:: UniverseJavaSearchListener:: operator*()
| Returns | The wrapped Java object. |
|---|
Gives the Java object that is wrapped in this UniverseJavaSearchListener.
void Universe:: UniverseJavaSearchListener:: start() override
Notifies this listener that the solver starts its search.
void Universe:: UniverseJavaSearchListener:: onPositiveDecision(const Universe:: IUniverseVariable& decisionVariable,
const Universe:: BigInteger& value) override
| Parameters | |
|---|---|
| decisionVariable | The variable on which the decision is taken. |
| value | The value assigned to the variable. |
Notifies this listener that a positive decision (a variable assignment x = v) is going to be taken.
void Universe:: UniverseJavaSearchListener:: onNegativeDecision(const Universe:: IUniverseVariable& decisionVariable,
const Universe:: BigInteger& value) override
| Parameters | |
|---|---|
| decisionVariable | The variable on which the decision is taken. |
| value | The value refuted for the variable. |
Notifies this listener that a negative decision (a variable refutation x != v) is going to be taken.
void Universe:: UniverseJavaSearchListener:: onPropagation(const Universe:: IUniverseVariable& variable,
const Universe:: BigInteger& value) override
| Parameters | |
|---|---|
| variable | The variable for which an assignment has been enforced. |
| value | The value propagated for the variable. |
Notifies this listener that a variable assignment has been enforced by propagation.
void Universe:: UniverseJavaSearchListener:: onAssignment(const Universe:: IUniverseVariable& variable,
const Universe:: BigInteger& value) override
| Parameters | |
|---|---|
| variable | The variable that is being assigned. |
| value | The value assigned to the variable. |
Notifies this listener that a variable is being assigned (either following a decision or a propagation).
void Universe:: UniverseJavaSearchListener:: onFailedAssignment(const Universe:: IUniverseVariable& variable,
const Universe:: BigInteger& value) override
| Parameters | |
|---|---|
| variable | The variable that has been assigned. |
| value | The value assigned to the variable. |
Notifies this listener that a variable assignment x = v has immediately failed due to propagations.
void Universe:: UniverseJavaSearchListener:: onConflict(const Universe:: IUniverseConstraint& constraint,
const Universe:: IUniverseVariable& variable) override
| Parameters | |
|---|---|
| constraint | A conflicting constraint. |
| variable | A conflicting variable in the constraint. |
Notifies this listener that a conflict has occurred.
void Universe:: UniverseJavaSearchListener:: onLearning(const Universe:: IUniverseConstraint& noGood) override
| Parameters | |
|---|---|
| noGood | The learned constraint. |
Notifies this listener that a constraint has been learned, following a conflict analysis or a similar process.
void Universe:: UniverseJavaSearchListener:: onBacktrack(int level) override
| Parameters | |
|---|---|
| level | The decision level at which the solver is backtracking. |
Notifies this listener that the solver is performing a backtrack (or backjump).
void Universe:: UniverseJavaSearchListener:: onBacktrack(const Universe:: IUniverseVariable& decisionVariable) override
| Parameters | |
|---|---|
| decisionVariable | The decision variable to which the solver is backtracking. |
Notifies this listener that the solver is performing a backtrack (or backjump).
void Universe:: UniverseJavaSearchListener:: onUnassignment(const Universe:: IUniverseVariable& variable) override
| Parameters | |
|---|---|
| variable | The variable that is being unassigned. |
Notifies this listener that a variable is being unassigned (during a backtrack for instance).
void Universe:: UniverseJavaSearchListener:: onRestart() override
Notifies this listener that the solver is performing a restart.
void Universe:: UniverseJavaSearchListener:: onCleaning() override
Notifies this listener that the solver is cleaning its no-good database.
void Universe:: UniverseJavaSearchListener:: onDelete(const Universe:: IUniverseConstraint& noGood) override
| Parameters | |
|---|---|
| noGood | The no-good that is being deleted. |
Notifies this listener that the solver is deleting one of its no-goods.
void Universe:: UniverseJavaSearchListener:: onSolutionFound(const std::map<Universe:: IUniverseVariable*, Universe:: BigInteger>& solution) override
| Parameters | |
|---|---|
| solution | The solution that has been found. |
Notifies this listener that the solver has found a solution.
void Universe:: UniverseJavaSearchListener:: onSolutionFound(const std::map<Universe:: IUniverseVariable*, Universe:: BigInteger>& solution,
const Universe:: BigInteger& cost) override
| Parameters | |
|---|---|
| solution | The solution that has been found. |
| cost | The cost of the solution (determined by an objective function given to the solver). |
Notifies this listener that the solver has found a solution.
void Universe:: UniverseJavaSearchListener:: end(Universe:: UniverseSolverResult result) override
| Parameters | |
|---|---|
| result | The result obtained by the solver. |
Notifies this listener that the solver has ended its search.