connectionRules
Class NeighborReinforce

java.lang.Object
  |
  +--connectionRules.NeighborReinforce
All Implemented Interfaces:
LearningRule

public class NeighborReinforce
extends java.lang.Object
implements LearningRule

A strategy learning rule that is like reinforcement dynamics. This learning rule reinforces both a players strategy with their payoff but also the neighbors' strategy with the neighbor's payoff (in the player's weights). This can be done at some discount.


Constructor Summary
NeighborReinforce()
          Returns a NeighborReinforce object.
NeighborReinforce(double n)
          Returns a NeighborReinforce object with specified neigbor discount factor.
 
Method Summary
 double getNeighDiscount()
          Returns the neighbor discount rate.
 void newGeneration(Individual i)
          Prepares the individual for a new round of play.
 int pickStrat(Individual i)
          Choose a strategy for the individual based on the wieghts by the standard reinforcement method.
 void processPayoff(Individual i)
          This function is run after the payoffs are updated for all individuals.
 void setNeighDiscount(double n)
          Sets the neighbor discount rate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeighborReinforce

public NeighborReinforce()
Returns a NeighborReinforce object. The default discount factor is no discount at all


NeighborReinforce

public NeighborReinforce(double n)
Returns a NeighborReinforce object with specified neigbor discount factor.

Parameters:
n - The neighbor discount factor
Method Detail

setNeighDiscount

public void setNeighDiscount(double n)
Sets the neighbor discount rate. This is the rate at which weights are discounted if the weights come from a neighbors actions.

Parameters:
n - The discount rate (1.0 = no discount)

getNeighDiscount

public double getNeighDiscount()
Returns the neighbor discount rate.

Returns:
The discount rate

newGeneration

public void newGeneration(Individual i)
                   throws ModelError
Prepares the individual for a new round of play. This just aplies the past discount factor to the wieghts.

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

processPayoff

public void processPayoff(Individual i)
                   throws ModelError
This function is run after the payoffs are updated for all individuals. This adds the weights for both the individual and neighbors strategy (possibly at some discount)

Specified by:
processPayoff in interface LearningRule
Parameters:
i - The calling invidual
Throws:
ModelError - If there is a problem

pickStrat

public int pickStrat(Individual i)
Choose a strategy for the individual based on the wieghts by the standard reinforcement method.

Specified by:
pickStrat in interface LearningRule
Parameters:
i - The calling Individual
Returns:
The strategy choosen