|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectipdlx.Strategy
public abstract class Strategy
Base abstract class for all strategies.
| Field Summary | |
|---|---|
protected double |
lastResult
info about last game's result. |
protected int |
nrOfOpponents
|
protected double |
opponentMove
info about last opponent's move - did he defect or cooperate. |
protected double[] |
opponentsMoves
info about last opponent's move - did he defect or cooperate. |
| Fields inherited from interface ipdlx.PDValues |
|---|
COOPERATE, DEFAULT_MISTAKE_LEVEL, DEFAULT_PUNISHMENT, DEFAULT_REWARD, DEFAULT_SUCKER, DEFAULT_TEMPTATION, DEFECT, EXIT, moves, PLAYER_A, PLAYER_B |
| Constructor Summary | |
|---|---|
Strategy(java.lang.String abbrName,
java.lang.String name,
java.lang.String description)
Constructor for "dirty" strategies. |
|
| Method Summary | |
|---|---|
protected java.lang.Object |
clone()
returns full name of the strategy |
java.lang.String |
getAbbrName()
returns strategy abbreviated name |
java.lang.String |
getDescription()
returns strategy description |
double |
getFinalMove(double move)
Deprecated. This used to implement noise, but is now implemeneted in the Game class. |
java.lang.String |
getFullName()
|
abstract double |
getMove()
returns move |
java.lang.String |
getName()
returns strategy name |
int |
getNumberOfOpponents()
|
double |
getOpponentMove()
|
double[] |
getOpponentsMoves()
|
protected double |
getResult()
returns strategy result |
void |
reset()
sets the initial state of this strategy |
void |
setLastResult(double lastResult)
|
void |
setNumberOfOpponents(int nrOfOpponents)
|
void |
setOpponentMove(double opponentMove)
setter for opponentMove field. |
void |
setOpponentsMoves(double[] opponentsMoves)
setter for opponentsMoves field. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double opponentMove
protected double[] opponentsMoves
protected double lastResult
protected int nrOfOpponents
| Constructor Detail |
|---|
public Strategy(java.lang.String abbrName,
java.lang.String name,
java.lang.String description)
abbrName - abbreviated name of strategy, eg. "TFT"name - name of strategy, eg. "Tit-For-Tat"description - description of strategy, how does it works, when does it
coopearate and defect| Method Detail |
|---|
public abstract double getMove()
public void setLastResult(double lastResult)
public final int getNumberOfOpponents()
public final void setNumberOfOpponents(int nrOfOpponents)
protected final double getResult()
public java.lang.String getDescription()
public java.lang.String getName()
public java.lang.String getAbbrName()
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic java.lang.String getFullName()
public final void setOpponentMove(double opponentMove)
opponentMove - last move of the opponentpublic final void setOpponentsMoves(double[] opponentsMoves)
opponentsMoves - last move of all the opponentspublic final double[] getOpponentsMoves()
public final double getOpponentMove()
public final double getFinalMove(double move)
public void reset()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||