|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--learningRules.SmoothBGLearning
This is a strategy learning model for the Bala Goyal Model. This model presumes there are n states of the world and n strategies. It then has the individuals update probabilites based on the state of the world. The best response rule is a probabilistic (smoothed) best response.
Constructor Summary | |
SmoothBGLearning(Game[] g,
double gam)
Initializing a BgLearning model. |
Method Summary | |
void |
newGeneration(Individual i)
This does nothing since there is no discounting or anything. |
int |
pickStrat(Individual i)
This function chooses a strategy for the player. |
static double |
probs(double[] x)
This calculates 1/(e^x[0]+e^x[1]+...+e^x[n]) It returns a double which is a rounded version of the result |
void |
processPayoff(Individual i)
This processes a payoff for an individual. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SmoothBGLearning(Game[] g, double gam)
g
- The games array containing all the possible games one for each state of the
worldMethod Detail |
public static final double probs(double[] x)
x
- The list of exponents
public void newGeneration(Individual i) throws ModelError
newGeneration
in interface LearningRule
i
- The individual calling the function
ModelError
- (although, since this does nothing it will never be thrown)public void processPayoff(Individual i) throws ModelError
processPayoff
in interface LearningRule
i
- The individual calling the function
ModelError
- if something fails durring updatingpublic int pickStrat(Individual i)
e^(E(1)/gamma) / *(e^(E(1)/gamma) + e^(E(2)/gamma))where E(x) is the expectation of action x and gamma is a parameter which corresponds to the amount of "smoothing" that occurs (i.e. the higher the gamma the further from the best response correspondence the function is).
pickStrat
in interface LearningRule
i
- The calling individual
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |