Package jline.lang.reward
Class TabulatedRewardFunction
java.lang.Object
jline.lang.reward.TabulatedRewardFunction
- All Implemented Interfaces:
Serializable,RewardFunction
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a pre-computed reward value for a specific aggregated state.doublecompute(Matrix state, NetworkStruct sn) Compute the reward value for a given state.intsize()Gets the number of tabulated states.toString()
-
Constructor Details
-
TabulatedRewardFunction
public TabulatedRewardFunction()
-
-
Method Details
-
addValue
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
Description copied from interface:RewardFunctionCompute the reward value for a given state.- Specified by:
computein interfaceRewardFunction- 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 isn- The NetworkStruct providing access to rates, parameters, etc.- Returns:
- The reward value for this state
-
toString
-