Battleground Agent¶
-
class
battleground.agent.
Agent
(**kwargs)[source]¶ This is an interface for the agent class. Every agent should sub-class this class. The entrypoint for this class is the move() function.
-
get_memory
(default=None)[source]¶ This function can be used by an agent to get its persistent memory. This function is also used by site runner to get the agent’s memory at the end of a game and store it in the database.
Parameters: default – if the agent memory is not set, return the default value (None). Returns: the persistent memory of the agent.
-
move
(state)[source]¶ Main entry point for the agent class, agent logic goes here. This function is called by the game runner when it’s this agent’s turn to make a move.
Parameters: state – the current game state. Returns: a valid move.
-