learningRules
Class BgLearning

java.lang.Object
  |
  +--learningRules.BgLearning
All Implemented Interfaces:
LearningRule

public class BgLearning
extends java.lang.Object
implements LearningRule

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 base on the state of the world.

Author:
Kevin Zollman

Constructor Summary
BgLearning(Game[] g)
          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.
 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

BgLearning

public BgLearning(Game[] g)
Initializing a BgLearning model.

Parameters:
g - The games array containing all the possible games one for each state of the world
Method Detail

newGeneration

public void newGeneration(Individual i)
                   throws ModelError
This does nothing since there is no discounting or anything.

Specified by:
newGeneration in interface LearningRule
Parameters:
i - The individual calling the function
Throws:
ModelError - (although, since this does nothing it will never be thrown)

processPayoff

public void processPayoff(Individual i)
                   throws ModelError
This processes a payoff for an individual. This function performs standard Bayesian updating based the the most recent payoff received This function should only be called after the game has been played.

Specified by:
processPayoff in interface LearningRule
Parameters:
i - The individual calling the function
Throws:
ModelError - if something fails durring updating

pickStrat

public int pickStrat(Individual i)
This function chooses a strategy for the player. It uses a simple best response to its beliefs function. The best response is deterministic.

Specified by:
pickStrat in interface LearningRule
Parameters:
i - The calling individual