FRAMES NO FRAMES

Class IloExplainer

Definition file: ilsolver/iloexplain.h
Include file: <ilsolver/iloexplain.h>

Solver provides the ability to explain why a particular solution has been proposed. The class IloExplainer defines the abstract protocol of this explanation facility. This protocol consists of three queries:

Subclasses of the class IloExplainer may use different deduction mechanisms for finding explanations. The subclass IloSolverExplainer uses the constraint propagation mechanism of Solver as a deduction mechanism.

Note
This functionality is available for pure Solver code only. It will not work on IBM® ILOG® Dispatcher or IBM ILOG Scheduler code.
Attribute Summary
protected IloExplainerI *_impl
Method Summary
public voidend()
public IloExplainerI *getImpl() const
public IloModelwhy(IloConstraint ct)
public IloModelwhyFail()
public IloModelwhyNot(IloConstraint ct)
Attribute Detail

_impl

protected IloExplainerI * _impl

This constructor creates a handle of an explanation object with the implementation object impl.


Method Detail

end

public void end()

This member function terminates the explainer and frees internally allocated memory.


getImpl

public IloExplainerI * getImpl() const

This member function returns the implementation object of the invoking explanation object.


why

public IloModel why(IloConstraint ct)

If the constraint ct is satisfied in the solution of the invoking explainer, this member function returns an argument for ct. The argument is a minimal subset of the set of constraints of this solution that is sufficient to deduce the constraint ct. The argument is represented by an instance of the class IloModel. If the constraint ct is not satisfied in the solution of the invoking explainer, an exception IloExplainer::NoExplanationException is raised. If ct is an IloExistsComponent constraint, the argument shows why the associated component was included in the configuration.


whyFail

public IloModel whyFail()

If the solution of the invoking explainer is inconsistent (that is, it leads to a failure when extracted by a solver), this member function returns a conflict. The conflict is a minimal subset of the set of constraints of this solution that is sufficient to produce a failure. The conflict is represented by an instance of the class IloModel. If the solution of the invoking explainer is consistent, an exception IloExplainer::NoExplanationException is raised.


whyNot

public IloModel whyNot(IloConstraint ct)

If the constraint ct is violated in the solution of the invoking explainer, this member function returns a counterargument for ct. The counterargument is a minimal subset of the set of constraints of this solution that is sufficient to refute the constraint ct. The counterargument is represented by an instance of the class IloModel. If the constraint ct is not violated in the solution of the invoking explainer, an exception IloExplainer::NoExplanationException is raised.