|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.inferencesupport.Solution
Solution object to model the attributes and behavior of solutions to the ConstraintProblem.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
UnitTest#testConstraintProblem
Field Summary | |
static int |
DEFAULT_VERBOSITY
The default verbosity of the solution output. |
protected int |
nbrSolutionsFound
Number of solutions found by the search. |
protected java.lang.Integer |
nbrSolutionsRequested
The number of solutions requested in the parent object. |
protected java.util.ArrayList |
solutions
List of solutions where each solution is a list of constraint variable - domain value bindings which satisfy all the constraint rules. |
protected int |
verbosity
Sets verbosity of the constraint solver output. |
Constructor Summary | |
Solution(java.lang.Integer nbrSolutionsRequested,
int verbosity)
Constructs a new Solution object given the parent ConstraintProblem object. |
Method Summary | |
void |
addBindingSet(BindingSet bindingSet)
Adds the solutions contained in the given binding set. |
void |
addBindingToCurrentSolution(Binding binding)
Adds the variable / value binding to the current solution. |
void |
addSolution(java.util.ArrayList solution)
Adds a new solution to the solution set. |
void |
displaySolution(java.util.ArrayList solution)
Displays the bindings in a given solution to the constraint problem. |
void |
displaySolutions()
Displays the bindings in all solutions to the constraint problem. |
void |
finalizeAllSolutions()
Removes the current empty solution in the special case where all solutions were requested and where all solutions were found. |
java.util.ArrayList |
getCurrentSolution()
Returns the current solution. |
int |
getNbrSolutionsFound()
Returns the number of solutions found. |
java.util.ArrayList |
getSolutions()
Returns all solutions. |
void |
recordNewSolution(Binding binding)
Records the current solution state by copying the current solution into a new partial solution without including the given binding, which is already part of a prior solution. |
void |
removeBindingFromCurrentSolution(Binding binding)
Removes the variable / value binding from the current solution. |
void |
setNbrSolutionsFound(int nbrSolutionsFound)
Sets the number of solutions found. |
void |
setSolutions(java.util.ArrayList solutions)
Sets solutions to the given list of solutions. |
void |
setVerbosity(int verbosity)
Sets verbosity of the constraint solver output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_VERBOSITY
protected int verbosity
protected java.lang.Integer nbrSolutionsRequested
protected int nbrSolutionsFound
protected java.util.ArrayList solutions
Constructor Detail |
public Solution(java.lang.Integer nbrSolutionsRequested, int verbosity)
parent
- the parent ConstraintProblem or QueryProcessor objectMethod Detail |
public void addBindingSet(BindingSet bindingSet)
bindingSet
- the binding set whose variable value bindings are to be added to the solutionpublic void addBindingToCurrentSolution(Binding binding)
binding
- the variable / value binding to be addedpublic void removeBindingFromCurrentSolution(Binding binding)
binding
- the variable / value binding to be removedpublic void addSolution(java.util.ArrayList solution)
the
- new solution ArrayList of Binding objects
to be added to the solution setpublic java.util.ArrayList getCurrentSolution()
public void setNbrSolutionsFound(int nbrSolutionsFound)
nbrSolutionsFound
- the new value for the number of solutions foundpublic int getNbrSolutionsFound()
public java.util.ArrayList getSolutions()
public void setSolutions(java.util.ArrayList solutions)
solutions
- the list of solutionspublic void recordNewSolution(Binding binding)
binding
- the variable / value binding, which is not to be included in the
new partial solutionpublic void displaySolution(java.util.ArrayList solution)
public void displaySolutions()
public void finalizeAllSolutions()
public void setVerbosity(int verbosity)
verbosity
- 0 --> quiet ... 9 -> maximum diagnostic input
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |