|
Evolving Strategies for the Prisoner's Dilemma | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ie.errity.pd.Rules
This class represents the rules for a Game of the Prisoner's Dilemma.
Payoff Matrix used is
-------------------------
|Cooperate |Defect |
-----------------------------------
|Cooperate| R,R | S,T |
-----------------------------------
|Defect | T,S | P,P |
-----------------------------------
| Constructor Summary | |
Rules()
Default constructor Initialises rules as follows: Game Iterations = 100, T = 5, S = 0, R = 3, P = 1, Mutation probability = .95, Generations = 250, Number of Players = 50, |
|
Rules(int it,
int t,
int s,
int r,
int p)
Create new game rules with specified parameters |
|
Rules(int it,
int t,
int s,
int r,
int p,
double m,
double c)
Create new game rules with specified parameters |
|
Rules(int it,
int t,
int s,
int r,
int p,
double m,
double c,
int gen,
int pl)
Create new game rules with specified parameters |
|
| Method Summary | |
double |
getCrossP()
|
int |
getGenerations()
|
int |
getIterations()
|
double |
getMutateP()
|
int |
getNumPlayers()
|
int |
getP()
|
int |
getR()
|
int |
getS()
|
int |
getT()
|
void |
setCrossP(double cp)
|
void |
setGenerations(int g)
|
void |
setIterations(int it)
|
void |
setMutateP(double mp)
|
void |
setNumPlayers(int p)
|
void |
setP(int p)
|
void |
setR(int r)
|
void |
setS(int s)
|
void |
setT(int t)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Rules()
public Rules(int it,
int t,
int s,
int r,
int p)
it - the number of PD games to play in an iterated PDt - the T value for the above payoff matrixs - the S value for the above payoff matrixr - the R value for the above payoff matrixp - the P value for the above payoff matrix
public Rules(int it,
int t,
int s,
int r,
int p,
double m,
double c)
it - the number of PD games to play in an iterated PDt - the T value for the above payoff matrixs - the S value for the above payoff matrixr - the R value for the above payoff matrixp - the P value for the above payoff matrixm - the probability of mutationc - the probability of crossover
public Rules(int it,
int t,
int s,
int r,
int p,
double m,
double c,
int gen,
int pl)
it - the number of PD games to play in an iterated PDt - the T value for the above payoff matrixs - the S value for the above payoff matrixr - the R value for the above payoff matrixp - the P value for the above payoff matrixm - the probability of mutationc - the probability of crossovergen - the maximum number of generationspl - the number of players| Method Detail |
public int getIterations()
public int getT()
public int getS()
public int getR()
public int getP()
public double getMutateP()
public double getCrossP()
public int getNumPlayers()
public int getGenerations()
public void setIterations(int it)
it - the number of PD games to play in an iterated PDpublic void setT(int t)
t - the T value for the above payoff matrixpublic void setS(int s)
s - the S value for the above payoff matrixpublic void setR(int r)
r - the R value for the above payoff matrixpublic void setP(int p)
p - the P value for the above payoff matrixpublic void setMutateP(double mp)
mp - the probability of mutationpublic void setCrossP(double cp)
cp - the probability of crossoverpublic void setNumPlayers(int p)
p - the number of playerspublic void setGenerations(int g)
g - the maximum number of generations
|
Andrew Errity [99086921] | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||