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 SingleAction |
myCoop
This agent's cooperate action
|
protected SingleAction |
myDefect
This agent's defect action
|
protected SingleAction |
opponentCoop
The opponent's cooperate action
|
protected SingleAction |
opponentDefect
The opponent's defect action
|
Constructor and Description |
---|
TitForTat.TitForTatAgentFactory(SGDomain domain,
SingleAction coop,
SingleAction defect)
Initializes with the specified cooperate and defect actions for both players.
|
TitForTat.TitForTatAgentFactory(SGDomain domain,
SingleAction myCoop,
SingleAction myDefect,
SingleAction opponentCoop,
SingleAction opponentDefect)
Initializes with differently specified cooperate and defect actions for both players.
|
Modifier and Type | Method and Description |
---|---|
Agent |
generateAgent()
Returns a new agent instance.
|
protected SingleAction myCoop
protected SingleAction myDefect
protected SingleAction opponentCoop
protected SingleAction opponentDefect
protected SGDomain domain
public TitForTat.TitForTatAgentFactory(SGDomain domain, SingleAction coop, SingleAction defect)
domain
- the domain in which this agent will play.coop
- the cooperate action for both playersdefect
- the defect action for both playerspublic TitForTat.TitForTatAgentFactory(SGDomain domain, SingleAction myCoop, SingleAction myDefect, SingleAction opponentCoop, SingleAction 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 Agent generateAgent()
AgentFactory
generateAgent
in interface AgentFactory