public static class TitForTat.TitForTatAgentFactory 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
This agent's cooperate action
|
protected Action |
myDefect
This agent's defect action
|
protected Action |
opponentCoop
The opponent's cooperate action
|
protected Action |
opponentDefect
The opponent's defect action
|
Constructor and Description |
---|
TitForTatAgentFactory(SGDomain domain,
Action coop,
Action defect)
Initializes with the specified cooperate and defect actions for both players.
|
TitForTatAgentFactory(SGDomain domain,
Action myCoop,
Action myDefect,
Action opponentCoop,
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 opponentCoop
protected Action opponentDefect
protected SGDomain domain
public TitForTatAgentFactory(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 TitForTatAgentFactory(SGDomain domain, Action myCoop, Action myDefect, Action opponentCoop, Action opponentDefect)
domain
- the domain in which this agent will playmyCoop
- the agent's cooperate actionmyDefect
- the agent's defect actionopponentCoop
- the opponent's cooperate actionopponentDefect
- the opponent's defect actionpublic SGAgent generateAgent(java.lang.String agentName, SGAgentType type)
AgentFactory
SGAgent
generateAgent
in interface AgentFactory
agentName
- the name for the agenttype
- the SGAgentType
for the agentSGAgent