Changing the learning rule

Changing the learning rule in the current model

The default learning rule (until you change it) is ImitateBestNeighbor, which uses a randomized tie-breaking rule.  Two other predefined learning rules are available: BestResponse and ImitateBestNormalizedScore.  These rules operate in the following way:

ImitateBestNeighbor

An agent compares her score with the score of all of her neighbors.  If there is only one strategy with the highest score, then she adopts that strategy.  If more than one strategy with the highest score exists, she chooses a strategy to adopt at random.
BestResponse
For each strategy i, an agent calculates the payoff that she would receive if she followed strategy i and every person in her neighborhood continues to follow their present strategy.  She then adopts the strategy with the highest expected payoff.  If more than one strategy with the highest expected payoff exists, she chooses a strategy to adopt at random.
ImitateBestNormalizedScore
An agent calculates the normalized score for each of her neighbors, adopting the strategy with the highest normalized score.  The normalized score for an agent N is N's score divided by the number of neighbors N has.

You switch between these rules using SetLearningRule. To switch to the BestResponse learning rule, invoke this command with the name of the learning rule as follows:
SetLearningRule( BestResponse );
Switching to the other two learning rules is done by replacing BestResponse with the name of the desired learning rule.

The learning rule can be switched at any time, even in the middle of a run.

The next model created (using "New model..." from the pull-down menu) will be created using the default learning rule.

Changing the default learning rule

The default learning rule is changed with the SetDefaultLearningRule command.  This command uses the same names for the learning rules as SetLearningRule. To change the default learning rule to BestResponse, simply call SetDefaultLearningRule with BestResponse as an argument:
SetDefaultLearningRule( BestResponse );
Custom learning rules can be added to the program and used just like predefined learning rules.