|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--models.StandardModel
This is a class that runs the Standard Model of Bayesian Learning in Networks.
Constructor Summary | |
StandardModel()
Does nothing |
|
StandardModel(int n)
Creates a new StandardModel with a specified number of individuals. |
Method Summary | |
void |
createPlayersHigh(Individual[] inds,
int s)
Forms a new network of specified size; expects random to be set. |
void |
createPlayersHigh(Individual[] inds,
int s,
ConnectionRule c,
LearningRule l,
double m,
double z)
Forms a new network of specified size; expects random to be set. |
void |
createPlayersHigh(Individual[] inds,
int s,
ConnectionRule c,
LearningRule l,
Game g,
double m,
double z)
Forms a new network of specified size; expects random to be set. |
void |
createPlayersLow(Individual[] inds)
Forms a new network of specified size; doesn't expect much to be set. |
int |
detectConvergence(int sow)
Checks to see if individuals have converged. |
Game[] |
getGames()
Returns the games for StandardModel |
Individual[] |
getIndividuals()
Returns the set of individuals for the model. |
MersenneTwister |
getRandom()
Returns the random number generator for the model. |
static void |
main(java.lang.String[] args)
Main, runs a model. |
void |
playGen()
Plays a generation and then resets. |
void |
setGames(Game[] g)
Sets an array of games, one for each state of the world. |
void |
setIndividuals(Individual[] i)
Sets the list of individuals for the model. |
void |
setRandom(MersenneTwister r)
Sets the random number generator. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StandardModel()
public StandardModel(int n)
n
- The size of the networkMethod Detail |
public void setGames(Game[] g)
g
- The array of Game objectspublic Game[] getGames()
public void setIndividuals(Individual[] i)
i
- An array of individualspublic Individual[] getIndividuals()
public void setRandom(MersenneTwister r)
r
- the mersennetwister random number generatorpublic MersenneTwister getRandom()
public void createPlayersLow(Individual[] inds)
inds
- A list of individualspublic void createPlayersHigh(Individual[] inds, int s) throws ModelError
inds
- A list of individualss
- The number of states of the world
ModelError
- If an initialization errorpublic void createPlayersHigh(Individual[] inds, int s, ConnectionRule c, LearningRule l, double m, double z) throws ModelError
inds
- A list of individualss
- The number of states of the worldc
- The connection rule used for forming network connections by each individuall
- The learning rule used for determining strategies by each individualm
- The mutation rate for each individual to reset their beliefsz
- The zero-state constraint for beliefs (initial beliefs cannot be lower than z)
ModelError
- If something fails during initializationpublic void createPlayersHigh(Individual[] inds, int s, ConnectionRule c, LearningRule l, Game g, double m, double z) throws ModelError
inds
- A list of individualss
- The number of states of the worldc
- The connection rule used for forming network connections by each individuall
- The learning rule used for determining strategies by each individualg
- The games used in the modelm
- The mutation rate for each individual to reset their beliefsz
- The zero-state constraint for beliefs (initial beliefs cannot be lower than z)
ModelError
- If something fails during initializationpublic void playGen() throws ModelError
ModelError
- If something bad happenspublic int detectConvergence(int sow) throws ModelError
sow
- What is the actual state of the world?
ModelError
public static void main(java.lang.String[] args)
args
- The command line arguments
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |