CombatAgent

public class CombatAgent extends Agent

Constructors

CombatAgent

public CombatAgent(int playernum, String[] otherargs)

CombatAgent

public CombatAgent(int playerNum, int[] enemies, boolean wanderWhileIdle, boolean verbose)

Construct a combat agent.

Parameters:
  • playerNum – The player number of this agent
  • enemies – The player numbers of enemies
  • wanderWhileIdle – Whether to move in random directions when you have nothing better to do.
  • verbose – Verbosity

CombatAgent

public CombatAgent(int playerNum)

Methods

getUsage

public static String getUsage()

initialStep

public Map<Integer, Action> initialStep(StateView newstate, History.HistoryView statehistory)

Start a new trial. Uses the StateView, which contains information in logs, resources, and units Some of the unit information may be in the template

Parameters:
  • newstate

loadPlayerData

public void loadPlayerData(InputStream is)

middleStep

public Map<Integer, Action> middleStep(StateView newstate, History.HistoryView statehistory)

savePlayerData

public void savePlayerData(OutputStream os)

terminalStep

public void terminalStep(StateView newstate, History.HistoryView statehistory)