See: Description
Interface | Description |
---|---|
PrisonersDilemmaActor | |
PrisonersDilemmaAgent |
A class that implements Agent determines how a player in the game will behave.
|
PrisonersDilemmaGame |
Class | Description |
---|---|
IterationResult | |
PrisonersDilemmaAgent.Adapter | |
Settings |
Enum | Description |
---|---|
PrisonersDilemmaActor.Action |
API for strategies ("agents") which play the iterated Prisoners Dilemma game. To write an agent, either:
In either case, the strategy goes in the agent's PrisonersDilemmaAgent.run()
method. It works by commanding a PrisonersDilemmaActor
which performs actions in the PrisonersDilemmaGame
. The actor also provides all available information from the game. Here's a sample run
method that implements TIT FOR TAT:
public void run() { PrisonersDilemmaGame game = actor.getGame(); // first move: IterationResult result = actor.cooperate(); // subsequent moves: while (game.isRunning()) { result = actor.act(result.otherPlayerAction); } }See the
Agent
docs for details.