jmarkov.jmdp.solvers

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

- java.lang.Object
- - jmarkov.jmdp.solvers.Solver<S,A>
  - - jmarkov.jmdp.solvers.AbstractInfiniteSolver<S,A>
    - - jmarkov.jmdp.solvers.AbstractAverageSolver<S,A>
      - - jmarkov.jmdp.solvers.RelativeValueIterationSolver<S,A>

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

      public class RelativeValueIterationSolver<S extends State,A extends Action>
      extends AbstractAverageSolver<S,A>

  This class solves the average cost criteria for infinite horizon problems
  Author:
    Andres Sarmiento, Germán Riaño and Daniel F. Silva

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RelativeValueIterationSolver(CTMDP<S,A> problem)` Creates a new solver for a continuous time, infinite horizon problem.
    `RelativeValueIterationSolver(CTMDP<S,A> problem, double factor)` Creates a new solver for a continuous time, infinite horizon problem to be solved with the modified relative value iteration method.
    `RelativeValueIterationSolver(DTMDP<S,A> problem)` The constructor method exclusively receives a discrte time infinite horizon problem of the type DTMDP.
    `RelativeValueIterationSolver(DTMDP<S,A> problem, double factor)` Creates a new solver for the given discrete time, infinite horizon problem.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getGain()`
    `long` | `getIterations()`
    `long` | `getProcessTime()`
    `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` | `setFactor(double factor)` Sets the factor for the modified relative value iteration method.
    `void` | `setPrintBias(boolean val)`
    `void` | `setPrintGain(boolean val)`
    `void` | `setPrintValueFunction(boolean val)` Option to print the final value function for each state.
    `Solution<S,A>` | `solve()` Called to solve the problem.

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

      `getProblem`

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

      `description, getOptimalPolicy, getOptimalValueFunction, getValueFunction, isSolved, setPrintProcessTime, 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

    - #### RelativeValueIterationSolver

          public RelativeValueIterationSolver(DTMDP<S,A> problem)

      The constructor method exclusively receives a discrte time infinite horizon problem of the type DTMDP.
      Parameters:
        `problem` - the structure of the problem of type InfiniteMDP

    - #### RelativeValueIterationSolver

          public RelativeValueIterationSolver(DTMDP<S,A> problem,
                                      double factor)

      Creates a new solver for the given discrete time, infinite horizon problem. It uses the modified relative value iteration method. For details, consult the User's Manual. The factor helps avoiding periodicity in the chain.
      Parameters:
        `problem` - problem
        `factor` - factor

    - #### RelativeValueIterationSolver

          public RelativeValueIterationSolver(CTMDP<S,A> problem)

      Creates a new solver for a continuous time, infinite horizon problem.
      Parameters:
        `problem` - continuous time, infinite horizon problem

    - #### RelativeValueIterationSolver

          public RelativeValueIterationSolver(CTMDP<S,A> problem,
                                      double factor)

      Creates a new solver for a continuous time, infinite horizon problem to be solved with the modified relative value iteration method.
      Parameters:
        `problem` - continuous time, infinite horizon problem
        `factor` -

  - ### Method Detail

    - #### setPrintValueFunction

          public void setPrintValueFunction(boolean val)

      Description copied from class: `Solver`
      Option to print the final value function for each state. It is set to false by default.
      Overrides:
        `setPrintValueFunction` in class `Solver<S extends State,A extends Action>`
      Parameters:
        `val` - True if the value function is to be reported.

    - #### setFactor

          public void setFactor(double factor)

      Sets the factor for the modified relative value iteration method.
      Parameters:
        `factor` - A number between 0 and 1.

    - #### 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()`

    - #### solve

          public 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.

    - #### getProcessTime

          public final long getProcessTime()

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

    - #### getIterations

          public final long getIterations()

      Specified by:
        `getIterations` in class `AbstractInfiniteSolver<S extends State,A extends Action>`
      Returns:
        Returns the iterations.

    - #### setPrintBias

          public void setPrintBias(boolean val)

    - #### setPrintGain

          public void setPrintGain(boolean val)

    - #### getGain

          public double getGain()

    - #### printSolution

          public void printSolution(java.io.PrintWriter pw)

      Description copied from class: `Solver`
      Prints the solution on a given PrintWriter.
      Overrides:
        `printSolution` in class `AbstractInfiniteSolver<S extends State,A extends Action>`
      See Also:
        `PrintWriter`

    - #### printSolution

          public void printSolution()
                             throws java.lang.Exception

      Prints the solution in the default PrintWriter (System.out)
      Overrides:
        `printSolution` in class `Solver<S extends State,A extends Action>`
      Throws:
        `java.lang.Exception`