|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Solver
Describes a general solver for a constraint satisfaction problem
represented as a Problem instance.
| Field Summary | |
|---|---|
static int |
BENCHMARK_FORMAT
|
static int |
DETAILED_FORMAT
|
| Method Summary | |
|---|---|
int |
eval(Tuple tuple)
Evaluates a tuple and returns a value between ValuationStructure.MIN and ValuationStructure.MAX
In case of classical satisfaction problem the returned values are
ValuationStructure.ALLOWED(=MIN) or ValuationStructure.FORBIDDEN(=MAX) |
Analyzer |
getAnalyzer()
|
Problem |
getProblem()
Returns a reference to the problem beeing solved. |
int |
getTimeLimit()
Returns the time limit that has been imposed. |
boolean |
isPaused()
Returns true if the solver is paused. |
boolean |
isRunning()
Returns true if the solver is running. |
void |
logResult(java.lang.String filename,
int format)
Writes the result of the algorithm to a log file. |
int |
optimum()
Returns the current optimum. |
void |
printResult(java.io.PrintStream out,
int format)
Prints the result of the algorithm. |
void |
setAnalyzer(Analyzer analyzer)
|
void |
setPaused(boolean paused)
Causes the solver to pause or to resume execution. |
void |
setProblem(Problem problem)
Sets a problem to be solved. |
void |
setTimeLimit(int limit)
Sets a limit for the solving process. |
Tuple |
solution()
Returns the current (partial) solution. |
TupleSet |
solutions()
Returns the solutions found and memorized so far. |
Tuple |
solve()
Solves the problem and returns a single solution or null if a solution cannot be found. |
TupleSet |
solve(int solutionsLimit)
Solves the problem and returns a specified number of solutions or null if no solution can be found |
TupleSet |
solveAll()
Solves the problem and returns all solutions or null if no solution can be found |
void |
stop()
Stops permanently the solver. |
| Field Detail |
|---|
static final int DETAILED_FORMAT
static final int BENCHMARK_FORMAT
| Method Detail |
|---|
Problem getProblem()
void setProblem(Problem problem)
problem - the problem to be solvedProblemAnalyzer getAnalyzer()
void setAnalyzer(Analyzer analyzer)
int getTimeLimit()
void setTimeLimit(int limit)
boolean isRunning()
void stop()
boolean isPaused()
setPaused(false) to resume the execution.
true if the solver is pause, false
if the solver is runningvoid setPaused(boolean paused)
paused - if true, the solver will pause, otherwise it will
resume executionTuple solve()
null if a solution cannot be found.
null if the problem is inconsistentTupleSet solve(int solutionsLimit)
null if no solution can be found
TupleSet solveAll()
null if no solution can be found
null if the problem
is inconsistentTuple solution()
TupleSet solutions()
int optimum()
int eval(Tuple tuple)
ValuationStructure.MIN and ValuationStructure.MAX
In case of classical satisfaction problem the returned values are
ValuationStructure.ALLOWED(=MIN) or ValuationStructure.FORBIDDEN(=MAX)
ValuationStructure.MIN and
ValuationStructure.MAXValuationStructure
void printResult(java.io.PrintStream out,
int format)
out - a PrintStreamformat - DETAILED_FORMAT or BENCHMARK_FORMAT;
void logResult(java.lang.String filename,
int format)
filename - a filenameformat - DETAILED_FORMAT or BENCHMARK_FORMAT;
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||