Enum BalkingStrategy

java.lang.Object
java.lang.Enum<BalkingStrategy>
jline.lang.constant.BalkingStrategy
All Implemented Interfaces:
Serializable, Comparable<BalkingStrategy>, java.lang.constant.Constable

public enum BalkingStrategy extends Enum<BalkingStrategy> implements Serializable
Constants for specifying balking strategies (customer refusal to join queue). Balking occurs when a customer arrives at a queue but decides not to join. The decision can be based on: - QUEUE_LENGTH: Balking probability depends on current queue length - EXPECTED_WAIT: Balking probability depends on expected waiting time - COMBINED: Both conditions are evaluated (OR logic - balk if either triggers) ID values match MATLAB BalkingStrategy constants.
  • Enum Constant Details

    • QUEUE_LENGTH

      public static final BalkingStrategy QUEUE_LENGTH
      Balking based on queue length. Uses thresholds mapping queue length ranges to balking probabilities. Example: balk with 50% probability when queue length is between 5-10.
    • EXPECTED_WAIT

      public static final BalkingStrategy EXPECTED_WAIT
      Balking based on expected waiting time. Customer estimates waiting time and balks if it exceeds their patience threshold. Requires knowledge of service rate for estimation.
    • COMBINED

      public static final BalkingStrategy COMBINED
      Combined balking strategy. Customer balks if EITHER the queue-length threshold OR expected-wait condition triggers. Provides flexibility for complex balking behaviors.
  • Method Details

    • values

      public static BalkingStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BalkingStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getID

      public int getID()
      Get the numeric ID for this balking strategy. IDs match MATLAB BalkingStrategy constants.
      Returns:
      numeric ID
    • fromID

      public static BalkingStrategy fromID(int id)
      Convert numeric ID to BalkingStrategy enum value.
      Parameters:
      id - numeric balking strategy ID
      Returns:
      corresponding BalkingStrategy enum value
      Throws:
      IllegalArgumentException - if ID is not recognized
    • toText

      public static String toText(BalkingStrategy strategy)
      Convert BalkingStrategy to human-readable text.
      Parameters:
      strategy - the balking strategy
      Returns:
      text description