learningRules
Class ImitateBestLearning

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

public class ImitateBestLearning
extends java.lang.Object
implements LearningRule

This is a learning rule where an individual adopts the strategy that did best on the previous round from among those strategies choosen by a neighbor. If another strategy is tied with the players current strategy, the player retains her current strategy. If two or more strategies are tied, but both better than her current strategy, she chooses amongst those at random.

Author:
Kevin Zollman

Constructor Summary
ImitateBestLearning(Game g)
          Constructor
 
Method Summary
 void newGeneration(Individual i)
          This does nothing since there is no discounting or anything.
 int pickStrat(Individual i)
          This function chooses the strategy which did best on the previous round.
 void processPayoff(Individual i)
          Processing a payoff does nothing, since there are no beliefs to be updated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImitateBestLearning

public ImitateBestLearning(Game g)
Constructor

Parameters:
g - The game
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
Processing a payoff does nothing, since there are no beliefs to be updated.

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

pickStrat

public int pickStrat(Individual i)
This function chooses the strategy which did best on the previous round. If the players previous strategy is tied with another as the best, the player keeps the strategy. If two strategies (not used by the player on the last round) are tied, the player chooses one at random.

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