S
- Current state.A
- Action taken.public abstract class MDP<S extends State,A extends Action>
extends java.lang.Object
Constructor and Description |
---|
MDP() |
Modifier and Type | Method and Description |
---|---|
void |
debug(int level,
java.lang.String message)
Prints a message in the reporter.
|
void |
debug(int level,
java.lang.String s,
boolean newline)
Prints debug information in the reporter.
|
void |
debug(int level,
java.lang.String s,
boolean newline,
boolean indent)
Prints debug information in the reporter.
|
int |
getDebugLevel()
Gets the current debug level.
|
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 costs.
|
void |
printSolution()
Prints the solution to Standard output.
|
void |
printSolution(java.io.PrintWriter pw)
Prints the solution to the given PrintWriter
|
void |
setDebugLevel(int level)
Sets teh current level
|
void |
setReporter(DebugReporter reporter) |
void |
setSolver(Solver<S,A> solver) |
void |
solve()
Solves the problem.
|
public final Policy<S,A> getOptimalPolicy() throws SolverException
SolverException
- Exception thrown if a solution cannot be foundpublic final boolean isSolved()
public final boolean isFinite()
public final void solve() throws SolverException
SolverException
- This Exception is thrown if a solution cannot be found.getDefaultSolver()
public ValueFunction<S> getOptimalValueFunction() throws SolverException
SolverException
- This exception is thrown if a solution cannot be found.public double operation(double present, double future)
present
- Cost of current transitionfuture
- Cost of future transitions.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
- messageDebugReporter
public void debug(int level, java.lang.String s, boolean newline, boolean indent)
level
- the level for the infos
- Messagenewline
- true if a new line is to be insertedindent
- true if the info is indented according to levelDebugReporter
,
DebugReporter.debug(int, java.lang.String, boolean, boolean)
public void debug(int level, java.lang.String s, boolean newline)
level
- the level for the infos
- Messagenewline
- true if a new line is to be insertedDebugReporter
,
DebugReporter.debug(int, java.lang.String, boolean)
public int getDebugLevel()
DebugReporter
,
DebugReporter.getDebugLevel()
public void setDebugLevel(int level)
level
- The new level to levelDebugReporter
,
DebugReporter.setDebugLevel(int)
public void printSolution()
public void printSolution(java.io.PrintWriter pw)
pw
- The PrintWriter where the solution will be printed. It must
have been initialized.