Package jline.lang.constant
Enum BalkingStrategy
- All Implemented Interfaces:
Serializable,Comparable<BalkingStrategy>,java.lang.constant.Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCombined balking strategy.Balking based on expected waiting time.Balking based on queue length. -
Method Summary
Modifier and TypeMethodDescriptionstatic BalkingStrategyfromID(int id) Convert numeric ID to BalkingStrategy enum value.intgetID()Get the numeric ID for this balking strategy.static StringtoText(BalkingStrategy strategy) Convert BalkingStrategy to human-readable text.static BalkingStrategyReturns the enum constant of this type with the specified name.static BalkingStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
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
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
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
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
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 nameNullPointerException- 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
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
Convert BalkingStrategy to human-readable text.- Parameters:
strategy- the balking strategy- Returns:
- text description
-