VisualAgent

public class VisualAgent extends Agent implements ActionListener

A visual agent This serves two purposes: it allows a human to play the game, and, more importantly, it allows one to look at what the agent is doing through it’s effect on the state.

Fields

actions

transient Map<Integer, Action> actions

controlPanel

ControlPanel controlPanel

gamePanel

GamePanel gamePanel

humanControllable

protected final boolean humanControllable

infoVis

protected final boolean infoVis

screen

GameScreen screen

statusPanel

StatusPanel statusPanel

Constructors

VisualAgent

public VisualAgent(int playernum, String[] otherargs)

VisualAgent

public VisualAgent(int playerNum, boolean humanControllable)
Parameters:
  • playerNum – The player number that this agent watches
  • humanControllable – Whether you can use the visual interface to control units.

Methods

actionPerformed

public void actionPerformed(ActionEvent e)

addAction

public void addAction(Action action)

getUsage

public static String getUsage()

initialStep

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

loadPlayerData

public void loadPlayerData(InputStream is)

middleStep

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

refreshStatusPanel

public void refreshStatusPanel(String status)

savePlayerData

public void savePlayerData(OutputStream os)

terminalStep

public void terminalStep(StateView newstate, HistoryView statehistory)