Class ChallengeBot


  • public abstract class ChallengeBot
    extends Bot
    A ChallengeBot is the scaffolding for Bot playing the game in challenge mode. This class will abstract the ConnectionHandler for easy usage in challenge mode. The Bot gets the opportunity once every second to play a move or decline to play one. This class limits the execution time of the bot, too.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BOT_TIMEOUT_MS
      time limit for computing one move
    • Constructor Summary

      Constructors 
      Constructor Description
      ChallengeBot()
      Empty default constructor.
    • Field Detail

      • BOT_TIMEOUT_MS

        public static final int BOT_TIMEOUT_MS
        time limit for computing one move
        See Also:
        Constant Field Values
    • Constructor Detail

      • ChallengeBot

        public ChallengeBot()
        Empty default constructor.
    • Method Detail

      • getStudentName

        public abstract java.lang.String getStudentName()
        Please return your name in a string.
        Returns:
        name of the student
      • getMatrikel

        public abstract int getMatrikel()
        Please return your „Matrikelnummer“ als int.
        Returns:
        matrikel number
      • getName

        public abstract java.lang.String getName()
        Here you can become creative. Please return the name of your Bot.
        Returns:
        bot name
      • executeTurn

        public abstract void executeTurn​(World world,
                                         Controller controller)
        This method be called every game resource tick. In real time this is every second. Then you are able to schedule a limited amount of actions with the Controller. The limit is for the main competition 1.
        Parameters:
        world - world object - describes the current world, with all data relevant to make a move.
        controller - game controller - use this communication abstraction to send game moves to the game.
      • startGame

        public final void startGame​(ConnectionHandler conn)
        Description copied from class: Bot
        Gets called on game start. A ConnectionHandler is given for sending and receiving messages from/to the game.
        Specified by:
        startGame in class Bot
        Parameters:
        conn - ConnectionHandler for sending and receiving
      • getModeName

        public final java.lang.String getModeName()
        Description copied from class: Bot
        API name of the mode
        Specified by:
        getModeName in class Bot
        Returns:
        mode string