public static class GrimTrigger.GrimTriggerAgentFactory extends java.lang.Object implements AgentFactory
| Modifier and Type | Field and Description |
|---|---|
protected SGDomain |
domain
The domain in which the agent will play
|
protected Action |
myCoop
The agent's cooperate action
|
protected Action |
myDefect
The agent's defect action
|
protected Action |
opponentDefect
The opponent's defect action
|
| Constructor and Description |
|---|
GrimTriggerAgentFactory(SGDomain domain,
Action coop,
Action defect)
Initializes with the specified cooperate and defect actions for both players.
|
GrimTriggerAgentFactory(SGDomain domain,
Action myCoop,
Action myDefect,
Action opponentDefect)
Initializes with differently specified cooperate and defect actions for both players.
|
| Modifier and Type | Method and Description |
|---|---|
SGAgent |
generateAgent(java.lang.String agentName,
SGAgentType type)
Generates a new
SGAgent |
protected Action myCoop
protected Action myDefect
protected Action opponentDefect
protected SGDomain domain
public GrimTriggerAgentFactory(SGDomain domain, Action coop, Action defect)
domain - the domain in which this agent will play.coop - the cooperate action for both playersdefect - the defect action for both playerspublic GrimTriggerAgentFactory(SGDomain domain, Action myCoop, Action myDefect, Action opponentDefect)
domain - the domain in which this agent will playmyCoop - the agent's cooperate actionmyDefect - the agent's defect actionopponentDefect - the opponent's defect actionpublic SGAgent generateAgent(java.lang.String agentName, SGAgentType type)
AgentFactorySGAgentgenerateAgent in interface AgentFactoryagentName - the name for the agenttype - the SGAgentType for the agentSGAgent