Class BotStrategyConfig

java.lang.Object
org.xxdc.oss.example.bot.BotStrategyConfig

public class BotStrategyConfig extends Object
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.
  • Method Details

    • getMaxIterations

      public Integer getMaxIterations()
      Returns the maximum number of iterations allowed for the bot strategy.
      Returns:
      the maximum number of iterations, or null if not set.
    • getMaxDepth

      public Integer getMaxDepth()
      Returns the maximum depth allowed for the bot strategy.
      Returns:
      the maximum depth, or null if not set.
    • getMaxTimeMillis

      public Long 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

      public static BotStrategyConfig.Builder newBuilder()
      Creates a new BotStrategyConfig.Builder instance.
      Returns:
      a new BotStrategyConfig.Builder instance
    • empty

      public static BotStrategyConfig empty()
      Returns an empty BotStrategyConfig instance.
      Returns:
      an empty BotStrategyConfig instance