jmdp.solvers
Class FiniteSolver<S extends State,A extends Action>

java.lang.Object
  extended by jmdp.solvers.Solver<S,A>
      extended by jmdp.solvers.AbstractFiniteSolver<S,A>
          extended by jmdp.solvers.FiniteSolver<S,A>

public class FiniteSolver<S extends State,A extends Action>
extends AbstractFiniteSolver<S,A>

This class belongs to the set of default solvers included in the jmdp package. It extends Solver and should only be used on FINITE horizon problems. The objective function of the solver is to minimize the the total cost. The result is a deterministic optimal policy for the given structure.

Author:
German Riano and Andres Sarmiento - Universidad de Los Andes

Field Summary
 
Fields inherited from class jmdp.solvers.Solver
policy, printProcessTime, printValueFunction, problem, solved, valueFunction
 
Constructor Summary
FiniteSolver(FiniteMDP<S,A> problem)
          Initialized the solver with the given getProblem().
 
Method Summary
 java.lang.String bestPolicy(S initial)
          Prints out the policy
 double future(S i, A a, int t)
          This method calculates the expected value of valueFunction for the current state i and a specified action a at the given stage t.
 long getProcessTime()
           
 Solution<S,A> solve()
          Called to solve the problem.
 java.lang.String toString()
          The sub classes must return the Solver name.
 
Methods inherited from class jmdp.solvers.AbstractFiniteSolver
getProblem
 
Methods inherited from class jmdp.solvers.Solver
getOptimalPolicy, getOptimalValueFunction, getValueFunction, isSolved, printSolution, printSolution, setPrintProcessTime, setPrintValueFunction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FiniteSolver

public FiniteSolver(FiniteMDP<S,A> problem)
Initialized the solver with the given getProblem().

Parameters:
problem - The problem to be solved.
Method Detail

solve

public final Solution<S,A> solve()
Description copied from class: Solver
Called to solve the problem. This method MUST write the local variable policy and valueFunction.

Specified by:
solve in class Solver<S extends State,A extends Action>

future

public final double future(S i,
                           A a,
                           int t)
                    throws java.lang.NullPointerException
This method calculates the expected value of valueFunction for the current state i and a specified action a at the given stage t.

Throws:
java.lang.NullPointerException

bestPolicy

public java.lang.String bestPolicy(S initial)
Prints out the policy

Parameters:
initial -
Returns:
a string with the optimal policy

getProcessTime

public final long getProcessTime()
Specified by:
getProcessTime in class Solver<S extends State,A extends Action>
Returns:
Returns the processTime.

toString

public java.lang.String toString()
Description copied from class: Solver
The sub classes must return the Solver name.

Specified by:
toString in class Solver<S extends State,A extends Action>
See Also:
Solver.toString()