Class THSim

java.lang.Object
  |
  +--THSim

public class THSim
extends java.lang.Object

The main class for THSim v4.0

Copyright (c) 2004 Paul Vogt


Field Summary
protected static Context cxt
           
protected static Agent hearer
           
protected static java.util.List lAgents
           
protected static int lastID
           
protected static java.util.List lScoreFiles
           
protected static java.util.List lWordList
           
protected static java.util.List lWords
           
protected static int nAgents
           
protected static double noiseCxt
           
protected static Parameters parameters
           
protected static Stats pStats
           
protected static Agent speaker
           
 
Constructor Summary
THSim()
           
 
Method Summary
protected static void create_agents()
          Initialise a list of agents
static void main(java.lang.String[] pArgs)
          The main function of THSim.
protected static void reinitializeAgents(int lg)
          Reinitialise the list of agents
protected static void test()
          The function test() can be used to test any function specified inside.
protected static void testPopulation(int it)
          testPopulation(int it) is used to test the quality of the population.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cxt

protected static Context cxt

lAgents

protected static java.util.List lAgents

nAgents

protected static int nAgents

noiseCxt

protected static final double noiseCxt
See Also:
Constant Field Values

speaker

protected static Agent speaker

hearer

protected static Agent hearer

lastID

protected static int lastID

parameters

protected static Parameters parameters

pStats

protected static Stats pStats

lScoreFiles

protected static java.util.List lScoreFiles

lWordList

protected static java.util.List lWordList

lWords

protected static java.util.List lWords
Constructor Detail

THSim

public THSim()
Method Detail

create_agents

protected static void create_agents()
Initialise a list of agents


reinitializeAgents

protected static void reinitializeAgents(int lg)
Reinitialise the list of agents


test

protected static void test()
                    throws java.io.IOException
The function test() can be used to test any function specified inside.
This function was used for testing and debugging the system.
The example function is used to give a speaker a predefined
compositional language, which is then learnt by a hearer.

java.io.IOException

testPopulation

protected static void testPopulation(int it)
testPopulation(int it) is used to test the quality of the population.

In short, a fixed number of games are set up (i.e. different contexts).
In `each' game, each agent produces an utterance. In turn,
each agent tries to interpret each utterance. During this test-phase
no new knowledge is invented or learnt.

The output is in the form:

holistic agent type 0:
"TP it pCoh iCoh var pCohAdults iCohAdults pCohLearners iCohLearners"
holistic agent type 1:
"TP it pCoh iCoh pCohAdults iCohAdults pCohLearners iCohLearners"
compositional agent type 2:
"TP it pCoh iCoh comp simSyntax pCohAdults iCohAdults pCohLearners iCohLearners"

where:
TP is the identifier used to extract the test results from the standard output.
it is the iteration number
pCoh is the overal production coherence
iCoh is the interpretation accuracy
var is the average variance between meanings
comp is the compositionality measure
simSyntax is the similarity measure comparing the agents' grammars
pCohAdults is the coherence inside the adults population (i.e. the first half of the pop.)
iCohAdults is the accuracy inside the adults population
pCohLearners is the coherence inside the learners population
iCohLearners is the accuracy inside the learners population


main

public static void main(java.lang.String[] pArgs)
                 throws java.io.IOException
The main function of THSim. Here is where it all starts.

THsim starts with initialising all kinds of things, such as setting the parameters following those given, or following the default settings. The parameters are mostly stored in the Utils.Parameters class. The interactive canvas is initialised when required.

Then, the program waits for a start-signal. This may be given as an argument, or from the user-interface.

Given the start signal, the simulation starts, possibly after (re)initialising some data structures.

During the simulation, output is written to the standard output, which I usually redirect into a file for further analysis (only for linux users though). If the user interface is active, additional output is written there. Further output can be stored in files as specified with the arguments.

java.io.IOException