|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSALPMPE.ApproxAlgorithm
public class ApproxAlgorithm
Defines the approximate best response iterative algorithm. Computes convergence criteria, report solutions and long run indicators.
| Field Summary | |
|---|---|
(package private) static double[][] |
Combinatorial
combinatorial numbers, use to index states in small intances |
| Constructor Summary | |
|---|---|
ApproxAlgorithm()
Defines a new instance of the approximate best response iterative algorithm. |
|
| Method Summary | |
|---|---|
state[] |
allStates(ApproxLP ALP,
sol_sep[] q_sep)
Returns all states in state space, and their strategies. |
void |
computeIndicator(state[] sample,
java.io.BufferedWriter out_ind,
int niter,
double budslack,
double runningtime)
Computes simulated long run indicators of interest. |
boolean |
convergenceCriteria(double JBase,
double JRresponse,
double Tolerr,
int niter)
Checks if convergence criteria is met. |
void |
excelIndicator(state[] sample,
int niter,
double runningtime,
java.lang.String status)
Computes simulated long run indicators of interest (for log file). |
(package private) static void |
getCombinatorial()
Computes combinatorial coefficients use to index states for small instances. |
void |
killCplex(ApproxLP ALP)
Kills CPLEX instances and tries to release memory. |
static void |
main(java.lang.String[] args)
Class main routine. |
int |
maxInner(int niter)
Computes maximum number of inner iterations in computation of approximate best response. |
void |
reportCoeff(ApproxLP ALP)
Reports solution coefficients. |
void |
reportPolicy(ApproxLP ALP,
sol_sep[] q_sep)
Reports entry and exit equilibrium policies. |
void |
ReportProgress(double JBase,
double JRresponse,
double Tolerr,
int niter,
java.io.BufferedWriter out_sum)
Prints out algorithm's progress. |
void |
reportValue(ApproxLP ALP,
sol_sep[] q_sep)
Reports value function approximation and equilibrium investment policy. |
void |
solveEquilibrium()
Solves for the approximate equilibrium. |
void |
TotalNumberStates(int samplesize1,
int samplesize2)
Computes total number of states use in LP formulation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static double[][] Combinatorial
| Constructor Detail |
|---|
public ApproxAlgorithm()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
public void solveEquilibrium()
throws java.io.IOException
java.io.IOExceptionpublic void killCplex(ApproxLP ALP)
ALP - Instance of CPLEX model.
public boolean convergenceCriteria(double JBase,
double JRresponse,
double Tolerr,
int niter)
JBase - Simulated value function for a firm using the approximate best response to the incumbent strategy when competitors use the incumbent strategy.JRresponse - Simulated value function for a firm when all industry uses the incumbent strategy.Tolerr - Tolerance error for the convergence criteria.niter - Iteration number.
public void reportCoeff(ApproxLP ALP)
ALP - Instance of CPLEX model.
public void reportPolicy(ApproxLP ALP,
sol_sep[] q_sep)
ALP - Instance of approximate algorithm.q_sep - History of approximate linear program solutions.
public void reportValue(ApproxLP ALP,
sol_sep[] q_sep)
ALP - Instance of approximate algorithm.q_sep - History of approximate linear program solutions.
public void computeIndicator(state[] sample,
java.io.BufferedWriter out_ind,
int niter,
double budslack,
double runningtime)
sample - Sampled set of states.out_ind - Buffered writer for reporting indicators.niter - Iteration number.budslack - Value of slack variable in SALP implementation.runningtime - Algorithm's total running time.
public void excelIndicator(state[] sample,
int niter,
double runningtime,
java.lang.String status)
sample - Sampled set of states.niter - Iteration number.runningtime - Algorithm's total running time.status - CPLEX solver exit status.
public void ReportProgress(double JBase,
double JRresponse,
double Tolerr,
int niter,
java.io.BufferedWriter out_sum)
JBase - Simulated value function for a firm using the approximate best response to the incumbent strategy when competitors use the incumbent strategy.JRresponse - Simulated value function for a firm when industry use the incumbent strategy.Tolerr - Tolerance error for the convergence criteria.niter - Iteration number.out_sum - Buffered writer for reporting algorithm evolution.
public void TotalNumberStates(int samplesize1,
int samplesize2)
samplesize1 - Size of the sampled set of states.samplesize2 - Size of the additional set of states.public int maxInner(int niter)
niter - Iteration count.static void getCombinatorial()
public state[] allStates(ApproxLP ALP,
sol_sep[] q_sep)
q_sep - History of solutions to the approximate linear programs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||