Class TabulatedRewardFunction

java.lang.Object
jline.lang.reward.TabulatedRewardFunction
All Implemented Interfaces:
Serializable, RewardFunction

public class TabulatedRewardFunction extends Object implements RewardFunction, Serializable
A reward function backed by a lookup table over aggregated state vectors.

This class is used by language wrappers (e.g., the MATLAB JLINE bridge) to marshal opaque reward function handles: the handle values are pre-computed in the source language over the enumerable domain of aggregated states and stored in a lookup table, which the CTMC reward analyzer then queries per row of stateSpaceAggr.

The state is encoded as a string key of the form "n11,n12,...,nMK" where n_{i,k} is the number of class-k jobs at station i (the same encoding as PrecomputedCDFunction).

See Also:
  • Constructor Details

    • TabulatedRewardFunction

      public TabulatedRewardFunction()
  • Method Details

    • addValue

      public void addValue(Matrix state, double value)
      Adds a pre-computed reward value for a specific aggregated state.
      Parameters:
      state - the aggregated state vector (1 x M*K, station-major)
      value - the reward value for this state
    • size

      public int size()
      Gets the number of tabulated states.
      Returns:
      the number of pre-computed reward values
    • compute

      public double compute(Matrix state, NetworkStruct sn)
      Description copied from interface: RewardFunction
      Compute the reward value for a given state.
      Specified by:
      compute in interface RewardFunction
      Parameters:
      state - The state vector (row from stateSpaceAggr matrix) Format: [n_{1,1}, n_{1,2}, ..., n_{M,K}] where n_{i,k} is the number of class-k jobs at station i
      sn - The NetworkStruct providing access to rates, parameters, etc.
      Returns:
      The reward value for this state
    • toString

      public String toString()
      Overrides:
      toString in class Object