S - States class.A - Actions class.public abstract class Solver<S extends State,A extends Action> extends java.lang.Object implements JMarkovElement
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
description()
This method return a complete verbal describtion of this element.
|
Policy<S,A> |
getOptimalPolicy()
Gets the optimal policy.
|
ValueFunction<S> |
getOptimalValueFunction()
Gets the optimal ValueFunction.
|
MDP<S,A> |
getProblem()
Returns the problem associated wit this solver.
|
abstract long |
getProcessTime() |
ValueFunction<S> |
getValueFunction()
If the problem is solved, it will return the optimal value function.
|
boolean |
isSolved()
Tells whether the problem has been solved.
|
abstract java.lang.String |
label()
The sub classes must return the Solver name.
|
void |
printSolution()
Prints the solution in the default PrintWriter (System.out)
|
void |
printSolution(java.io.PrintWriter pw)
Prints the solution on a given PrintWriter.
|
void |
setPrintProcessTime(boolean val)
Option to print the time spent solving the problem.
|
void |
setPrintValueFunction(boolean val)
Option to print the final value function for each state.
|
abstract Solution<S,A> |
solve()
Called to solve the problem.
|
java.lang.String |
toString()
This calls label().
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitequalspublic MDP<S,A> getProblem()
public abstract Solution<S,A> solve() throws SolverException
SolverException - This exception is thrown if the solver cannot find a solution
for some reason.public final Policy<S,A> getOptimalPolicy() throws SolverException
SolverExceptionPolicypublic final ValueFunction<S> getValueFunction()
public final ValueFunction<S> getOptimalValueFunction() throws SolverException
SolverExceptionValueFunctionpublic final boolean isSolved()
public abstract java.lang.String label()
label in interface JMarkovElementtoString()public java.lang.String description()
JMarkovElementdescription in interface JMarkovElementJMarkovElement.label()public final java.lang.String toString()
toString in interface JMarkovElementtoString in class java.lang.ObjecttoString()public abstract long getProcessTime()
System.currentTimeMillis() to get the current
time.public void setPrintProcessTime(boolean val)
val - True if the Process tiem is to be reported, false otherwise.public void setPrintValueFunction(boolean val)
val - True if the value function is to be reported.public void printSolution(java.io.PrintWriter pw)
pw - PrintWriterpublic void printSolution()
throws java.lang.Exception
java.lang.Exception