Class Grid
java.lang.Object
simpaths.model.decisions.Grid
CLASS TO STORE DATA FOR GRID ASSOCIATED WITH SINGLE OPTIMISATION VARIABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleget(long index) METHOD TO GET VALUE FROM GRID STOREdoublegetChecked(States supplied, long index) doubleinterpolateAll(States supplied, boolean solutionCall) METHOD TO RETURN A NUMERICAL APPROXIMATION FOR THE GRID VALUE ASSOCIATED WITH A COMPLETE VECTOR OF STATE CHARACTERISTICS The method begins by identifying the grid slice associated with the supplied combination of discrete states Linear states are then approximated by a linear interpolation method, interpolateContinuousdoubleinterpolateContinuous(States supplied, int dimensions, long startingIndex) METHOD TO RETURN A NUMERICAL APPROXIMATION FOR THE GRID VALUE ASSOCIATED WITH THE SUBSET OF CONTINUOUS STATE CHARACTERISTICS Method uses linear interpolation methods to approximate value for grid slice associated with continuous state variables, as supplied by the interpolateAll() method.voidput(long index, double value) METHOD TO ADD VALUE TO GRID STORE
-
Constructor Details
-
Grid
CONSTRUCTOR
-
-
Method Details
-
put
public void put(long index, double value) METHOD TO ADD VALUE TO GRID STORE- Parameters:
index- storage index for valuevalue- value to add to store
-
get
public double get(long index) METHOD TO GET VALUE FROM GRID STORE- Parameters:
index- storage index for value- Returns:
- value retrieved from store
-
getChecked
-
interpolateAll
METHOD TO RETURN A NUMERICAL APPROXIMATION FOR THE GRID VALUE ASSOCIATED WITH A COMPLETE VECTOR OF STATE CHARACTERISTICS The method begins by identifying the grid slice associated with the supplied combination of discrete states Linear states are then approximated by a linear interpolation method, interpolateContinuous- Parameters:
supplied- full state combination (continuous and discrete)solutionCall- boolean equal to true if call is from the search routine for a maximum to the IO problem This flag is used to distinguish treatment of states that are considered discrete for the IO solution process and continuous otherwise (e.g. birth year)- Returns:
- numerical approximation of grid value
-
interpolateContinuous
METHOD TO RETURN A NUMERICAL APPROXIMATION FOR THE GRID VALUE ASSOCIATED WITH THE SUBSET OF CONTINUOUS STATE CHARACTERISTICS Method uses linear interpolation methods to approximate value for grid slice associated with continuous state variables, as supplied by the interpolateAll() method.- Parameters:
supplied- state combination to interpolate overdimensions- number of states to conduct the interpolation overstartingIndex- starting index for grid slice of interpolation- Returns:
- numerical approximation of grid value
-