Runner

public abstract class Runner

An abstract base for classes that manage running one or more episodes

Author:tim

Fields

agents

protected Agent[] agents

configuration

protected Configuration configuration

stateCreator

protected StateCreator stateCreator

Constructors

Runner

public Runner(Configuration configuration, StateCreator stateCreator, Agent[] agents)

Methods

loadAgentData

protected void loadAgentData(File directory, int agentIndex)

Force the agent with a specific index to store in the specified directory

Parameters:
  • directory – The directory to store in.
  • agentIndex
Throws:
  • FileNotFoundException

loadAgentData

protected void loadAgentData(File file, Agent agent)

run

public abstract void run()

saveAgentData

protected void saveAgentData(File directory, int agentIndex)

Save an agent. This stores a file (agent.agt) in the directory specified, overwriting the file and/or creating the directory as needed. The contents of the file is completely determined by the agent.

Parameters:
  • file – The directory to store the agent in.
  • agentIndex – The agent to store.
Throws:

saveAgentData

protected void saveAgentData(File file, Agent agent)

Save the agent’s data (using edu.cwru.sepia.agent.Agent.savePlayerData(java.io.OutputStream))

Parameters:
  • file
  • agent
Throws:
  • FileNotFoundException

saveHistory

protected void saveHistory(File file, History history)

saveReplay

protected void saveReplay(File file, State initState, History finalHistory)

Save the initial state and history, as is needed to construct a replay. This stores two files (history.xml and initstate.xml) in the directory specified, overwriting those files and/or creating the directory as needed.

Parameters:
  • file – The directory to store the replay in.
Throws:

saveState

protected void saveState(File file, State state)

Save the state as a specific file.

Parameters:
  • file – The file to save the state as.
  • state – The state to save.