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