|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bolinfest.prisonerbot.SimpleIterativeGame
public class SimpleIterativeGame
SimpleIterativeGame is an abstract data type containing
the details of an iterated Prisoner's Dilemma game.
| Constructor Summary | |
|---|---|
SimpleIterativeGame(String player1Name,
String player2Name,
PayoffMatrix matrix)
|
|
| Method Summary | |
|---|---|
protected void |
calculateRounds()
override this method to decide how the number of rounds will be determined |
boolean |
choicesEntered()
|
Iterator |
getIterations()
|
Iteration |
getLastIteration()
|
String |
getLeader()
|
int |
getNumberOfIterations()
|
int |
getNumRounds()
|
int[] |
getNumRoundsProposed()
|
PayoffMatrix |
getPayoffMatrix()
|
String |
getPlayer1Name()
|
String |
getPlayer2Name()
|
int[] |
getScore()
|
boolean |
isTieGame()
|
boolean |
recordChoice(String playerName,
Choice c)
Record the choice made by the player |
void |
recordChoices()
resets the choices and updates the score so game can proceed to next round |
boolean |
roundsEntered()
Indicates both players have suggested a valid number of rounds to play |
void |
setNumRoundsProposed(String playerName,
int n)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleIterativeGame(String player1Name,
String player2Name,
PayoffMatrix matrix)
player1Name - player2Name - matrix - | Method Detail |
|---|
public PayoffMatrix getPayoffMatrix()
getPayoffMatrix in interface UnmodifiableGame
public void setNumRoundsProposed(String playerName,
int n)
public boolean recordChoice(String playerName,
Choice c)
public boolean choicesEntered()
public void recordChoices()
protected void calculateRounds()
public int getNumRounds()
public boolean roundsEntered()
public int getNumberOfIterations()
getNumberOfIterations in interface UnmodifiableGamepublic int[] getScore()
getScore in interface UnmodifiableGamepublic String getLeader()
getLeader in interface UnmodifiableGamepublic boolean isTieGame()
public Iterator getIterations()
getIterations in interface UnmodifiableGamepublic String getPlayer1Name()
getPlayer1Name in interface UnmodifiableGamepublic String getPlayer2Name()
getPlayer2Name in interface UnmodifiableGamepublic Iteration getLastIteration()
public int[] getNumRoundsProposed()
getNumRoundsProposed in interface UnmodifiableGame
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||