|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PayoffMatrix
PayoffMatrix
tells the payoff for each player for every permutation of player choices.
PayoffMatrix
is immutable.
Field Summary | |
---|---|
static PayoffMatrix |
CANONICAL_PAYOFF_MATRIX
The "canonical" payoff matrix where: Mutual cooperation yields 3 points for each player. Successful defection yields 5 points for the defector and 0 points for the cooperator. Mutual defection yields 1 point for each player. |
Method Summary | |
---|---|
int[] |
calculatePayoff(Choice firstPlayerChoice,
Choice secondPlayerChoice)
Get the payoff for a given set of choices. |
int[] |
getAllPayoffs()
|
String |
getDescription()
|
String |
getName()
|
Field Detail |
---|
static final PayoffMatrix CANONICAL_PAYOFF_MATRIX
Method Detail |
---|
String getName()
String getDescription()
int[] calculatePayoff(Choice firstPlayerChoice, Choice secondPlayerChoice)
firstPlayerChoice
- the choice made by the first playersecondPlayerChoice
- the choice made by the second player
IllegalArgumentException
- if either choice is nullint[] getAllPayoffs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |