Package jline.util
Interface RewardFunction
-
- All Implemented Interfaces:
-
java.io.Serializable
@FunctionalInterface() public interface RewardFunction implements Serializable
Functional interface for defining reward functions on CTMC states. A reward function maps a state vector and network structure to a scalar reward value. This interface is used for CTMC reward computation via value iteration. Example usage:
// Queue length reward RewardFunction qlenReward = (state, sn) -> state.get(0, 1); // Throughput reward RewardFunction tputReward = (state, sn) -> { double n = state.get(0, 1); return n > 0 ? n * sn.rates.get(1, 0) / n : 0; };
-
-
Method Summary
Modifier and Type Method Description abstract doublecompute(Matrix state, NetworkStruct sn)Compute the reward value for a given state. -
-
Method Detail
-
compute
abstract double compute(Matrix state, NetworkStruct sn)
Compute the reward value for a given state.
- Parameters:
state- The state vector (row from stateSpaceAggr matrix) Format: [n_{1,1}, n_{1,2}, ...sn- The NetworkStruct providing access to rates, parameters, etc.- Returns:
The reward value for this state
-
-
-
-