jmarkov.jmdp.solvers

## Class FiniteSolver<S extends State,A extends Action>

- java.lang.Object
- - jmarkov.jmdp.solvers.Solver<S,A>
  - - jmarkov.jmdp.solvers.AbstractFiniteSolver<S,A>
    - - jmarkov.jmdp.solvers.FiniteSolver<S,A>

- Type Parameters:
    `S` - States class.
    `A` - Actions class.
  All Implemented Interfaces:
    JMarkovElement

      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:
    Germán Riaño and Andres Sarmiento - Universidad de Los Andes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FiniteSolver(FiniteMDP<S,A> problem)` Initialized the solver with the given getProblem().

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `bestPolicy(S initial)` Prints out the policy
    `long` | `getProcessTime()`
    `java.lang.String` | `label()` The sub classes must return the Solver name.
    `Solution<S,A>` | `solve()` Called to solve the problem.

    - ### Methods inherited from class jmarkov.jmdp.solvers.AbstractFiniteSolver

      `getProblem`

    - ### Methods inherited from class jmarkov.jmdp.solvers.Solver

      `description, getOptimalPolicy, getOptimalValueFunction, getValueFunction, isSolved, printSolution, printSolution, setPrintProcessTime, setPrintValueFunction, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jmarkov.basic.JMarkovElement

      `equals`

- - ### 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>`
      Returns:
        The solution Object taht contains the plicy and value fuenction.

    - #### bestPolicy

          public java.lang.String bestPolicy(S initial)
                                      throws SolverException

      Prints out the policy
      Parameters:
        `initial` -
      Returns:
        a string with the optimal policy
      Throws:
        `SolverException`

    - #### getProcessTime

          public final long getProcessTime()

      Specified by:
        `getProcessTime` in class `Solver<S extends State,A extends Action>`
      Returns:
        Returns the processTime.

    - #### label

          public java.lang.String label()

      Description copied from class: `Solver`
      The sub classes must return the Solver name.
      Specified by:
        `label` in interface `JMarkovElement`
      Specified by:
        `label` in class `Solver<S extends State,A extends Action>`
      Returns:
        A String label.
      See Also:
        `Solver.toString()`