jmarkov.jmdp.solvers
Class LPBCLDiscountedSolver<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>
              extended by jmarkov.jmdp.solvers.LPBCLDiscountedSolver<S,A>
Type Parameters:
S - States class.
A - Actions class.
All Implemented Interfaces:
JMarkovElement, LPSolver

public class LPBCLDiscountedSolver<S extends State,A extends Action>
extends AbstractDiscountedSolver<S,A>
implements LPSolver

This solver solves a discounted infinite horizon MDP by building and solving a linear problem using as interface Xpress BCL. It requires the professional version of XpressMP and the JAVA build path must include the xprb.jar libray, for running the applications.

Author:
Diego Bello, Germán Riaño. Universidad de los Andes.

Field Summary
 
Fields inherited from class jmarkov.jmdp.solvers.AbstractDiscountedSolver
discountFactor
 
Fields inherited from class jmarkov.jmdp.solvers.Solver
policy, printProcessTime, printValueFunction, problem, solved, valueFunction
 
Constructor Summary
LPBCLDiscountedSolver(DTMDP<S,A> problem, double interestRate)
          The constructor method receives a problem of the type infinite DTMDP and an interest rate that is modified for being used as discount factor.
 
Method Summary
 Solution<S,A> buildSolution()
          The implementator classes should override this class to build the solution after the model has been solved.
 java.lang.String description()
          This method return a complete verbal describtion of this element.
 long getBuildTime()
          Returns the time taken to build and write the MPS file.
 long getIterations()
           
 long getLpSolveTime()
          Return the time taken to solve the LP model.
 long getProcessTime()
           
 long getSolBuildTime()
          Returns the time needed to build the Solution after the LP was solved.
 java.lang.String label()
          The sub classes must return the Solver name.
 Solution<S,A> solve()
          Called to solve the problem.
 void solveLP()
          The implementator classes should override this class to solve the problem using the mpsFile that has been created.
 
Methods inherited from class jmarkov.jmdp.solvers.AbstractDiscountedSolver
future, future, getInterestRate, setDiscountFactor, setInterestRate
 
Methods inherited from class jmarkov.jmdp.solvers.AbstractInfiniteSolver
getDiscreteProblem, getProblem, printSolution
 
Methods inherited from class jmarkov.jmdp.solvers.Solver
getOptimalPolicy, getOptimalValueFunction, getValueFunction, isSolved, printSolution, setPrintProcessTime, setPrintValueFunction, 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
 

Constructor Detail

LPBCLDiscountedSolver

public LPBCLDiscountedSolver(DTMDP<S,A> problem,
                             double interestRate)
The constructor method receives a problem of the type infinite DTMDP and an interest rate that is modified for being used as discount factor. The discount factor and the problem gives necesary information for solving a discounted MDP.

Parameters:
problem - the structure of the problem of type infinite DTMDP.
interestRate - A rate which is paid for the use of a resource.
Method Detail

getIterations

public long getIterations()
Specified by:
getIterations in class AbstractInfiniteSolver<S extends State,A extends Action>
Returns:
Returns the iterations in the last solve.

solve

public Solution<S,A> solve()
                                                 throws SolverException
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.
Throws:
SolverException - This exception is thrown if the solver cannot find a solution for some reason.

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

description

public java.lang.String description()
Description copied from interface: JMarkovElement
This method return a complete verbal describtion of this element. This description may contain multiple text rows.

Specified by:
description in interface JMarkovElement
Overrides:
description in class Solver<S extends State,A extends Action>
Returns:
A String describing this element.
See Also:
JMarkovElement.label()

getProcessTime

public long getProcessTime()
Specified by:
getProcessTime in class Solver<S extends State,A extends Action>
Returns:
Returns the processTime of the last solve. Use System.currentTimeMillis() to get the current time.

getBuildTime

public long getBuildTime()
Description copied from interface: LPSolver
Returns the time taken to build and write the MPS file.

Specified by:
getBuildTime in interface LPSolver
Returns:
Returns the build time.

getLpSolveTime

public long getLpSolveTime()
Description copied from interface: LPSolver
Return the time taken to solve the LP model.

Specified by:
getLpSolveTime in interface LPSolver
Returns:
Returns the Linear Programming Solve Time

getSolBuildTime

public long getSolBuildTime()
Returns the time needed to build the Solution after the LP was solved.

Specified by:
getSolBuildTime in interface LPSolver
Returns:
Returns the solBuildTime.

solveLP

public void solveLP()
             throws SolverException
Description copied from interface: LPSolver
The implementator classes should override this class to solve the problem using the mpsFile that has been created.

Specified by:
solveLP in interface LPSolver
Throws:
SolverException
See Also:
LPSolver.solveLP()

buildSolution

public Solution<S,A> buildSolution()
                                                         throws SolverException
Description copied from interface: LPSolver
The implementator classes should override this class to build the solution after the model has been solved.

Specified by:
buildSolution in interface LPSolver
Returns:
The solution to the problem.
Throws:
SolverException
See Also:
LPSolver.buildSolution()