|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmdp.MDP<S,A>
public abstract class MDP<S extends State,A extends Action>
This class is the main framework to build a Dynamic Programming Problem. It�s initially created to work over Markov Decision Problems which imply random probabilities but can easily be worked out for deterministic problems if the probabilities are set to one. This class should not me extended directly on problems. The default package has FiniteMDP and InfiniteMDP classes that are intended to be extended on problems. See the examples for a clearer reference.
FiniteMDP
,
DTMDP
Field Summary | |
---|---|
protected boolean |
finite
States whether the problem is a finite horizon problem or not. |
States<S> |
initial
Set of initial states. |
protected DebugReporter |
reporter
|
Constructor Summary | |
---|---|
MDP()
|
Method Summary | |
---|---|
void |
debug(int level,
java.lang.String message)
Prints a message |
protected abstract Solver<S,A> |
getDefaultSolver()
The class that extends MDP must define the default solver to use. |
Policy<S,A> |
getOptimalPolicy()
Returns the optimal policy. |
ValueFunction<S> |
getOptimalValueFunction()
Returns the optimal ValueFunction. |
DebugReporter |
getReporter()
|
Solver<S,A> |
getSolver()
|
boolean |
isFinite()
|
boolean |
isSolved()
Indicates if the problems has been solved |
double |
operation(double present,
double future)
The Operator between present and future rewards. |
void |
printSolution()
Prints the solution to Standard output. |
void |
printSolution(java.io.PrintWriter pw)
Prints the solution to the given PrintWriter |
void |
setReporter(DebugReporter reporter)
|
void |
setSolver(Solver<S,A> solver)
|
void |
solve()
Solves the problem. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean finite
public States<S extends State> initial
protected DebugReporter reporter
Constructor Detail |
---|
public MDP()
Method Detail |
---|
public final Policy<S,A> getOptimalPolicy()
public final boolean isSolved()
public final boolean isFinite()
public final void solve()
getDefaultSolver()
public Solver<S,A> getSolver()
public void setSolver(Solver<S,A> solver)
solver
- The solver to set.protected abstract Solver<S,A> getDefaultSolver()
public ValueFunction<S> getOptimalValueFunction()
public double operation(double present, double future)
public DebugReporter getReporter()
public void setReporter(DebugReporter reporter)
reporter
- The reporter to set.public void debug(int level, java.lang.String message)
level
- maximum debug level at which to show messagemessage
- messagepublic void printSolution()
public void printSolution(java.io.PrintWriter pw)
pw
- The PrintWriter where the solution will be printed. It must
have been initialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |