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

java.lang.Object
  extended by jmarkov.jmdp.solvers.Solver<S,A>
      extended by jmarkov.jmdp.solvers.AbstractInfiniteSolver<S,A>
          extended by jmarkov.jmdp.solvers.AbstractDiscountedSolver<S,A>
Type Parameters:
S - state
A - action
All Implemented Interfaces:
JMarkovElement
Direct Known Subclasses:
LPBCLDiscountedSolver, MpsLpDiscountedSolver, PolicyIterationSolver, ValueIterationSolver

public abstract class AbstractDiscountedSolver<S extends State,A extends Action>
extends AbstractInfiniteSolver<S,A>

This is a structural class that must be extended by classes solving the dicounted cost minimization problem.

Author:
Andres Sarmiento and Germán Riaño - Universidad de Los Andes

Field Summary
protected  double discountFactor
          The discount factor used to bring to present value from next period.
 
Fields inherited from class jmarkov.jmdp.solvers.Solver
policy, printProcessTime, printValueFunction, problem, solved, valueFunction
 
Constructor Summary
protected AbstractDiscountedSolver(CTMDP<S,A> problem, double interestRate)
           
protected AbstractDiscountedSolver(DTMDP<S,A> problem, double interestRate)
           
 
Method Summary
protected  double future(S i, A a, double discountF)
          Expected value of valueFunction for the current state and a specified action.
protected  double future(S i, A a, double discountF, ValueFunction<S> vf)
          Expected value of valueFunction for the current state and a specified action.
 double getInterestRate()
          Returns the current value of the discount factor.
protected  void setDiscountFactor(double discountFactor)
           
 void setInterestRate(double interestRate)
          Sets a new Interest Rate
 
Methods inherited from class jmarkov.jmdp.solvers.AbstractInfiniteSolver
getDiscreteProblem, getIterations, getProblem, printSolution
 
Methods inherited from class jmarkov.jmdp.solvers.Solver
description, getOptimalPolicy, getOptimalValueFunction, getProcessTime, getValueFunction, isSolved, label, printSolution, setPrintProcessTime, setPrintValueFunction, solve, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmarkov.basic.JMarkovElement
equals
 

Field Detail

discountFactor

protected double discountFactor
The discount factor used to bring to present value from next period.

Constructor Detail

AbstractDiscountedSolver

protected AbstractDiscountedSolver(DTMDP<S,A> problem,
                                   double interestRate)
Parameters:
problem - The problem associated with this solver.
interestRate - The interest rate per period

AbstractDiscountedSolver

protected AbstractDiscountedSolver(CTMDP<S,A> problem,
                                   double interestRate)
Parameters:
problem - The problem associated with this solver.
interestRate - The interest rate (nominal compunded continuously). For example, if you measure time in months, and the APR is A, then this rate satisfies exp(i/12) = 1 + A. Therefore i=12*ln(1+A).
Method Detail

setInterestRate

public final void setInterestRate(double interestRate)
Sets a new Interest Rate

Parameters:
interestRate - set.

getInterestRate

public double getInterestRate()
Returns the current value of the discount factor.

Returns:
The current value of the discount factor.

setDiscountFactor

protected final void setDiscountFactor(double discountFactor)
Parameters:
discountFactor - The discountFactor to set.

future

protected final double future(S i,
                              A a,
                              double discountF,
                              ValueFunction<S> vf)
Expected value of valueFunction for the current state and a specified action.

Parameters:
discountF - is the rate for discounting from one period to another. It means how much less it would represent to receive one unit of the reward in the next period instead of receiving it in the present period.

future

protected final double future(S i,
                              A a,
                              double discountF)
Expected value of valueFunction for the current state and a specified action.

Parameters:
i - Ths State
a - Action taken
discountF - is the rate for discounting from one period to another. It means how much less it would represent to receive one unit of the reward in the next period instead of receiving it in the present period.
Returns:
Expected value of valueFunction.