Enum BalkingStrategy
-
- All Implemented Interfaces:
-
java.io.Serializable
public 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.
-
-
Field Summary
Fields Modifier and Type Field Description public final intid
-
Enum Constant Summary
Enum Constants Enum Constant Description QUEUE_LENGTHBalking 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_WAITBalking based on expected waiting time. Customer estimates waiting time and balks if it exceeds their patience threshold. Requires knowledge of service rate for estimation.
COMBINEDCombined balking strategy. Customer balks if EITHER the queue-length threshold OR expected-wait condition triggers. Provides flexibility for complex balking behaviors.
-
Method Summary
Modifier and Type Method Description static BalkingStrategyfromID(int id)Convert numeric ID to BalkingStrategy enum value. static StringtoText(BalkingStrategy strategy)Convert BalkingStrategy to human-readable text. static Array<BalkingStrategy>values()Returns an array containing the constants of this enum type, in the order they're declared. static BalkingStrategyvalueOf(String name)Returns the enum constant of this type with the specified name. intgetID()Get the numeric ID for this balking strategy. -
-
Method Detail
-
fromID
static BalkingStrategy fromID(int id)
Convert numeric ID to BalkingStrategy enum value.
- Parameters:
id- numeric balking strategy ID- Returns:
corresponding BalkingStrategy enum value
-
toText
static String toText(BalkingStrategy strategy)
Convert BalkingStrategy to human-readable text.
- Parameters:
strategy- the balking strategy- Returns:
text description
-
values
static Array<BalkingStrategy> values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.
- Returns:
an array containing the constants of this enum type, in the order they're declared
-
valueOf
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.)
- Returns:
the enum constant with the specified name
-
getID
int getID()
Get the numeric ID for this balking strategy. IDs match MATLAB BalkingStrategy constants.
- Returns:
numeric ID
-
-
-
-