models
Class RandomNetworkModel

java.lang.Object
  |
  +--models.RandomNetworkModel

public class RandomNetworkModel
extends java.lang.Object

This class implements a learning in network model with random network formation. This model uses beta-distribution learning (aka payoff learning).

Author:
Kevin Zollman

Field Summary
static MersenneTwister random
           
 
Constructor Summary
RandomNetworkModel(Individual[] i, Game g, LearningRule l, double m, double p)
           
 
Method Summary
 int detectConvergence(int optimal)
          Checks to see if the population has converged either to the correct state or the bad state.
 double getConnectProb()
          Gets the connection probability
 Game getGame()
          Returns the value of game.
 Individual[] getIndivids()
          Returns the value of indivis.
static void main(java.lang.String[] args)
           
 void playGen()
          Resets then plays a generation.
 void setConnectProb(double p)
          Sets the connection probability
 void setGame(Game game)
          Sets the value of game.
 void setIndivids(Individual[] individs)
          Sets the value of indivis.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

public static final MersenneTwister random
Constructor Detail

RandomNetworkModel

public RandomNetworkModel(Individual[] i,
                          Game g,
                          LearningRule l,
                          double m,
                          double p)
                   throws ModelError
Method Detail

getIndivids

public Individual[] getIndivids()
Returns the value of indivis.


setIndivids

public void setIndivids(Individual[] individs)
Sets the value of indivis.


getGame

public Game getGame()
Returns the value of game.


setGame

public void setGame(Game game)
Sets the value of game.

Parameters:
game - The value to assign game.

getConnectProb

public double getConnectProb()
Gets the connection probability

Returns:
The connection probability

setConnectProb

public void setConnectProb(double p)
Sets the connection probability

Parameters:
p - The connection probability

playGen

public void playGen()
             throws ModelError
Resets then plays a generation. This first calls each individuals reset function, then calls each individuals playGame function, then calles each individuals update function

Throws:
ModelError - If something bad happens

detectConvergence

public int detectConvergence(int optimal)
                      throws ModelError
Checks to see if the population has converged either to the correct state or the bad state. Convergence here only means individuals all persue the same strategy, so should not be used to stop a run.

Parameters:
optimal - The optimal action
Returns:
This function returns 0 if unconverged, 1 if converged to the true state, 2 if converged to the wrong state
ModelError

main

public static void main(java.lang.String[] args)