|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmarkov.jmdp.solvers.Solver<S,A>
S
- States class.A
- Actions class.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
The policy Object. |
protected boolean |
printProcessTime
True if the process time is to be reported |
protected boolean |
printValueFunction
true if the value function is to be reported |
protected MDP<S,A> |
problem
The problem to be solved |
protected boolean |
solved
Marker to indicate that the problem has been solved |
protected ValueFunction<S> |
valueFunction
The value function, to be written by the solver |
Constructor Summary | |
---|---|
protected |
Solver(MDP<S,A> problem)
Default constructor. |
Method Summary | |
---|---|
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(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmarkov.basic.JMarkovElement |
---|
equals |
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 |
---|
protected Solver(MDP<S,A> problem)
problem
- to be solved.Method Detail |
---|
public 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
SolverException
Policy
public final ValueFunction<S> getValueFunction()
public final ValueFunction<S> getOptimalValueFunction() throws SolverException
SolverException
ValueFunction
public final boolean isSolved()
public abstract java.lang.String label()
label
in interface JMarkovElement
toString()
public java.lang.String description()
JMarkovElement
description
in interface JMarkovElement
JMarkovElement.label()
public final java.lang.String toString()
toString
in interface JMarkovElement
toString
in class java.lang.Object
toString()
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
- PrintWriter
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 |