public class Tournament
extends java.lang.Object
SGAgentType role they will play as and how many matches there will be.| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<AgentFactory> |
agents |
protected int |
debugId |
protected int |
maxStages |
protected int |
numGames |
protected MatchSelector |
selector |
protected java.util.List<java.lang.Double> |
tournamentCumulatedReward |
protected WorldGenerator |
worldGenerator |
| Constructor and Description |
|---|
Tournament(int maxStages,
int numGames,
MatchSelector selector,
WorldGenerator worldGenerator)
Initializes the Tournament
|
Tournament(int maxStages,
MatchSelector selector,
WorldGenerator worldGenerator)
Initializes the Tournament
|
Tournament(java.util.List<AgentFactory> agents,
int maxStages,
int numGames,
MatchSelector selector,
WorldGenerator worldGenerator)
Initializes the Tournament
|
Tournament(java.util.List<AgentFactory> agents,
int maxStages,
MatchSelector selector,
WorldGenerator worldGenerator)
Initializes the Tournament
|
| Modifier and Type | Method and Description |
|---|---|
int |
addAgent(AgentFactory agent)
Adds an agent to the tournament
|
double |
getCumulativeRewardFor(int i)
Returns the cumulative reward received by the agent who is indexed at position i
|
int |
getNumAgents()
Returns the number of agents who are playing in this tournament
|
void |
printOutResults()
Prints the tournament results by agent index and their cumulative reward received in the tournament.
|
void |
resetTournamentReward()
Reset the cumulative reward received by each agent in this tournament.
|
void |
runTournament()
Runs the tournament
|
protected java.util.List<AgentFactory> agents
protected java.util.List<java.lang.Double> tournamentCumulatedReward
protected int maxStages
protected int numGames
protected MatchSelector selector
protected WorldGenerator worldGenerator
protected int debugId
public Tournament(int maxStages,
MatchSelector selector,
WorldGenerator worldGenerator)
maxStages - the maximum number of stages to be played in any single game of the tournament.selector - a match selector that dictates which agents will play who and in which gamesworldGenerator - a world generator to create new worlds for each matchpublic Tournament(int maxStages,
int numGames,
MatchSelector selector,
WorldGenerator worldGenerator)
maxStages - the maximum number of stages to be played in any single game of the tournament.numGames - the number of games that will be played for each agent matchingselector - a match selector that dictates which agents will play who and in which gamesworldGenerator - a world generator to create new worlds for each matchpublic Tournament(java.util.List<AgentFactory> agents, int maxStages, MatchSelector selector, WorldGenerator worldGenerator)
agents - the list of agents that will participate in the tournamentmaxStages - the maximum number of stages to be played in any single game of the tournament.selector - a match selector that dictates which agents will play who and in which gamesworldGenerator - a world generator to create new worlds for each matchpublic Tournament(java.util.List<AgentFactory> agents, int maxStages, int numGames, MatchSelector selector, WorldGenerator worldGenerator)
agents - the list of agents that will participate in the tournamentmaxStages - the maximum number of stages to be played in any single game of the tournament.numGames - the number of games that will be played for each agent matchingselector - a match selector that dictates which agents will play who and in which gamesworldGenerator - a world generator to create new worlds for each matchpublic int addAgent(AgentFactory agent)
agent - the agent to add to the tournamentpublic int getNumAgents()
public double getCumulativeRewardFor(int i)
i - the index of the agentpublic void resetTournamentReward()
public void printOutResults()
public void runTournament()