Class PriorityBot

All Implemented Interfaces:
Bot, Serializable, Cloneable, Map<Action,Double>
Direct Known Subclasses:
ColletBot, GeneralTacticBot, IrrigationMaster, RushPandaBot, SmartApplyWeather, SmartApplyWind, SmartChooseAndApplyWeather, SmartDrawImprovement, SmartDrawIrrigation, SmartGardener, SmartObjective, SmartPanda, SmartPattern, SmartPlaceIrrigation, SmartStoreIrrigation, WeatherMaster

public abstract class PriorityBot extends HashMap<Action,Double> implements Bot
See Also:
  • Field Details

  • Constructor Details

    • PriorityBot

      public PriorityBot()
  • Method Details

    • fillAction

      protected abstract void fillAction(Board board, BotState botState, History history)
    • compute

      protected PriorityBot compute(Board board, BotState botState, History history)
    • chooseAction

      public Action chooseAction(Board board, BotState botState, History history)
      Description copied from interface: Bot
      This method will allow the player to choose an action to execute.
      Specified by:
      chooseAction in interface Bot
      Parameters:
      board - The board of the game.
      botState - The state of the bot.
      Returns:
      The action chosen by the player.
    • addActionWithPriority

      protected void addActionWithPriority(Action action, double priority)
    • add

      protected void add(PriorityBot bot)
    • addWithOffset

      protected void addWithOffset(PriorityBot bot, double offset)
      This method is used to add a bot with an offset
    • addWithLinear

      protected void addWithLinear(PriorityBot bot, double multiplier)
      This method is used to add a bot with a Linear function offset
    • addWithAffine

      protected void addWithAffine(PriorityBot bot, double multiplier, double offset)
      This method is used to add a bot with Affine function offset
    • addWithSquash

      protected void addWithSquash(PriorityBot bot, double min, double max)
      This method is used to add a bot and squash the priority between two numbers
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<Action,Double>
      Overrides:
      equals in class AbstractMap<Action,Double>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<Action,Double>
      Overrides:
      hashCode in class AbstractMap<Action,Double>