|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmarkov.jmdp.solvers.Solver<S,A>
jmarkov.jmdp.solvers.AbstractInfiniteSolver<S,A>
jmarkov.jmdp.solvers.AbstractDiscountedSolver<S,A>
jmarkov.jmdp.solvers.MpsLpDiscountedSolver<S,A>
S
- States class.A
- Actions class.public abstract class MpsLpDiscountedSolver<S extends State,A extends Action>
This class builds a Linear Program for a discounted infinite horizon MDP in a MPS file. A extending class must code solveLP method in order to solve the problem.
solveLP()
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 | |
---|---|
|
MpsLpDiscountedSolver(DTMDP<S,A> problem,
double interestRate)
This is the default constructor for MpsLpDiscountedSolver class, and defines the label MDP for the MPS File. |
protected |
MpsLpDiscountedSolver(DTMDP<S,A> problem,
double interestRate,
boolean isAverage)
The constructor is used by the partner average solver. |
|
MpsLpDiscountedSolver(DTMDP<S,A> problem,
double interestRate,
java.lang.String workingDir,
java.lang.String fileName)
The constructor method exclusively receives a problem of the type infinite DTMDP , an interest rate that is modified for being used as discount factor and the name that the user wants for the MPS File. |
protected |
MpsLpDiscountedSolver(DTMDP<S,A> problem,
double interestRate,
java.lang.String workingDir,
java.lang.String fileName,
boolean isAverage)
The constructor is used by the partenr average solver. |
Method Summary | |
---|---|
abstract Solution<S,A> |
buildSolution()
The implementator classes should override this class to build the solution after the model has been solved. |
long |
getBuildTime()
Returns the time taken to build and write the MPS file. |
long |
getLpSolveTime()
Return the time taken to solve the LP model. |
java.io.File |
getMpsFile()
Returns the MPS file name. |
java.lang.String |
getMpsFileName()
Returns the MPS file name. |
long |
getProcessTime()
|
long |
getSolBuildTime()
Returns the time needed to build the Solution after the LP was solved. |
java.io.File |
getWorkingDir()
Returns the working directory (where the MPS file is located) |
boolean |
isAvg()
|
Solution<S,A> |
solve()
Called to solve the problem. |
abstract 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, getIterations, getProblem, printSolution |
Methods inherited from class jmarkov.jmdp.solvers.Solver |
---|
description, getOptimalPolicy, getOptimalValueFunction, getValueFunction, isSolved, label, 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 |
---|
public MpsLpDiscountedSolver(DTMDP<S,A> problem, double interestRate, java.lang.String workingDir, java.lang.String fileName)
problem
- The structure of the problem of type infinite
DTMDP.interestRate
- A rate which is paid for the use of a
resource.workingDir
- Where the MPS file will be created.fileName
- Name for the MPS File (with no path).public MpsLpDiscountedSolver(DTMDP<S,A> problem, double interestRate)
problem
- The structure of the problem of type infinite
DTMDP.interestRate
- A rate which is paid for the use of a
resource.protected MpsLpDiscountedSolver(DTMDP<S,A> problem, double interestRate, java.lang.String workingDir, java.lang.String fileName, boolean isAverage)
problem
- The structure of the problem of type infinite
DTMDP.interestRate
- A rate which is paid for the use of a
resource.workingDir
- Where the MPS file will be created.fileName
- Name for the MPS File (with no path).isAverage
- True if an average model is being built.protected MpsLpDiscountedSolver(DTMDP<S,A> problem, double interestRate, boolean isAverage)
problem
- The structure of the problem of type infinite
DTMDP.interestRate
- A rate which is paid for the use of a
resource.isAverage
- True if an average model is being built.Method Detail |
---|
public final java.lang.String getMpsFileName()
MpsLpSolver
getMpsFileName
in interface MpsLpSolver<S extends State,A extends Action>
public java.io.File getMpsFile()
MpsLpSolver
getMpsFile
in interface MpsLpSolver<S extends State,A extends Action>
public final java.io.File getWorkingDir()
getWorkingDir
in interface MpsLpSolver<S extends State,A extends Action>
public final boolean isAvg()
public abstract void solveLP() throws SolverException
solveLP
in interface LPSolver<S extends State,A extends Action>
SolverException
public abstract Solution<S,A> buildSolution() throws SolverException
buildSolution
in interface LPSolver<S extends State,A extends Action>
SolverException
public final Solution<S,A> solve() throws SolverException
Solver
solve
in class Solver<S extends State,A extends Action>
SolverException
- This exception is thrown if the solver cannot find a solution
for some reason.public final long getBuildTime()
LPSolver
getBuildTime
in interface LPSolver<S extends State,A extends Action>
public final long getLpSolveTime()
LPSolver
getLpSolveTime
in interface LPSolver<S extends State,A extends Action>
public final long getSolBuildTime()
LPSolver
getSolBuildTime
in interface LPSolver<S extends State,A extends Action>
public final long getProcessTime()
getProcessTime
in class Solver<S extends State,A extends Action>
System.currentTimeMillis()
to get the current
time.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |