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;
    };
    
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract double compute(Matrix state, NetworkStruct sn) Compute the reward value for a given state.
      • Methods inherited from class java.lang.Object

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

    • 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