|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmdp.solvers.Solver<S,A>
public abstract class Solver<S extends State,A extends Action>
Structural class for every solver. Any solver that a user implements must extend this class.
Field Summary | |
---|---|
protected Policy<S,A> |
policy
|
protected boolean |
printProcessTime
|
protected boolean |
printValueFunction
|
protected MDP<S,A> |
problem
|
protected boolean |
solved
|
protected ValueFunction<S> |
valueFunction
|
Constructor Summary | |
---|---|
Solver(MDP<S,A> problem)
Default constructor. |
Method Summary | |
---|---|
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. |
void |
printSolution()
Prints the solution in the default print writer (System.out) |
void |
printSolution(java.io.PrintWriter pw)
Prints the solution on a given print writer. |
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. |
abstract java.lang.String |
toString()
The sub classes must return the Solver name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Policy<S extends State,A extends Action> policy
protected ValueFunction<S extends State> valueFunction
protected boolean solved
protected MDP<S extends State,A extends Action> problem
protected boolean printProcessTime
protected boolean printValueFunction
Constructor Detail |
---|
public Solver(MDP<S,A> problem)
problem
- to be solved.Method Detail |
---|
public MDP<S,A> getProblem()
public abstract Solution<S,A> solve()
public final Policy<S,A> getOptimalPolicy()
Policy
public final ValueFunction<S> getValueFunction()
public final ValueFunction<S> getOptimalValueFunction()
ValueFunction
public final boolean isSolved()
public abstract java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public abstract long getProcessTime()
System.currentTimeMillis()
to get the current
time.public void setPrintProcessTime(boolean val)
public void setPrintValueFunction(boolean val)
public void printSolution(java.io.PrintWriter pw)
pw
- public void printSolution() throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |