learningRules
Class CondorcetLearning

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

public class CondorcetLearning
extends java.lang.Object
implements LearningRule

This class is a Condorcet Learning Rule. An individual looks around and adopts the strategey that the majority in his neighborhood are adopting.


Constructor Summary
CondorcetLearning()
          A constructor which automatically sets the number of strats at 2
CondorcetLearning(int s)
          A constructor which sets the number of strats
 
Method Summary
 void newGeneration(Individual i)
          There is no updating so this function does nothing
 int pickStrat(Individual i)
          This function censuses individual in the neighborhood and adopts the strategy used by the majority last round.
 void processPayoff(Individual i)
          All this does is update LastStrat.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CondorcetLearning

public CondorcetLearning(int s)
A constructor which sets the number of strats


CondorcetLearning

public CondorcetLearning()
A constructor which automatically sets the number of strats at 2

Method Detail

newGeneration

public void newGeneration(Individual i)
There is no updating so this function does nothing

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

pickStrat

public int pickStrat(Individual i)
This function censuses individual in the neighborhood and adopts the strategy used by the majority last round.

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

processPayoff

public void processPayoff(Individual i)
All this does is update LastStrat.

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