Class Grid

java.lang.Object
simpaths.model.decisions.Grid

public class Grid extends Object
CLASS TO STORE DATA FOR GRID ASSOCIATED WITH SINGLE OPTIMISATION VARIABLE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Grid(GridScale scale, long size)
    CONSTRUCTOR
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    get(long index)
    METHOD TO GET VALUE FROM GRID STORE
    double
    getChecked(States supplied, long index)
     
    double
    interpolateAll(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, interpolateContinuous
    double
    interpolateContinuous(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.
    void
    put(long index, double value)
    METHOD TO ADD VALUE TO GRID STORE

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Grid

      public Grid(GridScale scale, long size)
      CONSTRUCTOR
  • Method Details

    • put

      public void put(long index, double value)
      METHOD TO ADD VALUE TO GRID STORE
      Parameters:
      index - storage index for value
      value - 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

      public double getChecked(States supplied, long index)
    • interpolateAll

      public double interpolateAll(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, 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

      public double interpolateContinuous(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.
      Parameters:
      supplied - state combination to interpolate over
      dimensions - number of states to conduct the interpolation over
      startingIndex - starting index for grid slice of interpolation
      Returns:
      numerical approximation of grid value