Package jline.lang.reward
Interface RewardFunction
- All Superinterfaces:
Serializable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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 TypeMethodDescriptiondoublecompute(Matrix state, NetworkStruct sn) Compute the reward value for a given state.
-
Method Details
-
compute
Compute the reward value for a given state.- 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
-