Class BotStrategyConfig
java.lang.Object
org.xxdc.oss.example.bot.BotStrategyConfig
Represents the configuration for a bot strategy, including limits on the number of iterations,
depth, and maximum execution time. The
BotStrategyConfig.Builder class can be used to construct instances
of this class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for constructing aBotStrategyConfiginstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic BotStrategyConfigempty()Returns an emptyBotStrategyConfiginstance.booleanexceedsMaxDepth(int depth) Returns whether the current depth exceeds the maximum allowed depth for the bot strategy.booleanexceedsMaxIterations(int iterations) Returns whether the number of iterations for the bot strategy exceeds the maximum allowed.booleanexceedsMaxTimeMillis(long timeMillis) Returns whether the current execution time in milliseconds exceeds the maximum allowed time for the bot strategy.Returns the maximum depth allowed for the bot strategy.Returns the maximum number of iterations allowed for the bot strategy.Returns the maximum execution time in milliseconds allowed for the bot strategy.booleanReturns whether the maximum depth has been set for the bot strategy.booleanReturns whether the maximum number of iterations has been set for the bot strategy.booleanReturns whether the maximum execution time in milliseconds has been set for the bot strategy.static BotStrategyConfig.BuilderCreates a newBotStrategyConfig.Builderinstance.
-
Method Details
-
getMaxIterations
Returns the maximum number of iterations allowed for the bot strategy.- Returns:
- the maximum number of iterations, or null if not set.
-
getMaxDepth
Returns the maximum depth allowed for the bot strategy.- Returns:
- the maximum depth, or null if not set.
-
getMaxTimeMillis
Returns the maximum execution time in milliseconds allowed for the bot strategy.- Returns:
- the maximum execution time in milliseconds, or null if not set.
-
hasMaxIterations
public boolean hasMaxIterations()Returns whether the maximum number of iterations has been set for the bot strategy.- Returns:
- true if the maximum number of iterations has been set, false otherwise.
-
hasMaxDepth
public boolean hasMaxDepth()Returns whether the maximum depth has been set for the bot strategy.- Returns:
- true if the maximum depth has been set, false otherwise.
-
hasMaxTimeMillis
public boolean hasMaxTimeMillis()Returns whether the maximum execution time in milliseconds has been set for the bot strategy.- Returns:
- true if the maximum execution time in milliseconds has been set, false otherwise.
-
exceedsMaxIterations
public boolean exceedsMaxIterations(int iterations) Returns whether the number of iterations for the bot strategy exceeds the maximum allowed.- Parameters:
iterations- the current number of iterations- Returns:
- true if the number of iterations exceeds the maximum, false otherwise
-
exceedsMaxDepth
public boolean exceedsMaxDepth(int depth) Returns whether the current depth exceeds the maximum allowed depth for the bot strategy.- Parameters:
depth- the current depth- Returns:
- true if the current depth exceeds the maximum allowed depth, false otherwise
-
exceedsMaxTimeMillis
public boolean exceedsMaxTimeMillis(long timeMillis) Returns whether the current execution time in milliseconds exceeds the maximum allowed time for the bot strategy.- Parameters:
timeMillis- the current execution time in milliseconds- Returns:
- true if the current execution time exceeds the maximum allowed time, false otherwise
-
newBuilder
Creates a newBotStrategyConfig.Builderinstance.- Returns:
- a new
BotStrategyConfig.Builderinstance
-
empty
Returns an emptyBotStrategyConfiginstance.- Returns:
- an empty
BotStrategyConfiginstance
-