Util
Class CompositionalStats

java.lang.Object
  |
  +--Util.Stats
        |
        +--Util.CompositionalStats

public class CompositionalStats
extends Stats

Implementation of the statistics.

Copyright (c) 2004 Paul Vogt


Field Summary
protected  double[] comp
           
protected  double[] cs
           
protected  double[] ds
           
protected  int end
           
protected  int game
           
protected  int mid
           
 
Fields inherited from class Util.Stats
iCoherence, pCoherence, update
 
Constructor Summary
CompositionalStats()
          constructor
 
Method Summary
 double[] getComp()
           
 double getCompositionality()
           
 double[] getCS()
           
 double[] getDS()
           
 int getEnd()
           
 int getGame()
           
 double getICoh()
           
 int getMid()
           
 double getPCoh()
           
 boolean getUpdate()
           
 void logFile(java.io.PrintWriter outfile)
          This function writes the statistics of each game to the logfile.
 void print()
          Function to write the game information to the standard output
 void reinitialize(char c)
          This function reinitialises the statistics at the start of each iteration in the iterated learning model and when a new game is started.
protected  int rescale()
          This function rescales the arrays for the UI
 void update(Agent S, Agent H, int t)
          This function calls itself with an additional argument (test=false)
 void update(Agent S, Agent H, int t, boolean test)
          Updates the statistics at the end of each language game.
 void updateCoherence(double x, double y)
           
 void updateCoherence(double x, double y, double z)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cs

protected double[] cs

ds

protected double[] ds

comp

protected double[] comp

game

protected int game

mid

protected int mid

end

protected int end
Constructor Detail

CompositionalStats

public CompositionalStats()
constructor

Method Detail

rescale

protected int rescale()
This function rescales the arrays for the UI

Overrides:
rescale in class Stats

reinitialize

public void reinitialize(char c)
This function reinitialises the statistics at the start of each iteration in the iterated learning model and when a new game is started.

Specified by:
reinitialize in class Stats
Parameters:
c - ='n' if a new game is started.

update

public void update(Agent S,
                   Agent H,
                   int t)
This function calls itself with an additional argument (test=false)

Specified by:
update in class Stats
Parameters:
S - the speaker Agent
H - the hearer Agent
t - the agent's type

update

public void update(Agent S,
                   Agent H,
                   int t,
                   boolean test)
Updates the statistics at the end of each language game. The agents are used to check whether the game was successful or not.

Parameters:
S - the speaker Agent
H - the hearer Agent
t - the agent's type
test - whether the update is done during testing (true) or not.

logFile

public void logFile(java.io.PrintWriter outfile)
This function writes the statistics of each game to the logfile.

Specified by:
logFile in class Stats
Parameters:
outfile - the logfile.

print

public void print()
Function to write the game information to the standard output

Overrides:
print in class Stats

getComp

public double[] getComp()

getCS

public double[] getCS()
Overrides:
getCS in class Stats

getDS

public double[] getDS()
Overrides:
getDS in class Stats

getGame

public int getGame()
Overrides:
getGame in class Stats

getMid

public int getMid()
Overrides:
getMid in class Stats

getEnd

public int getEnd()
Overrides:
getEnd in class Stats

getICoh

public double getICoh()
Overrides:
getICoh in class Stats

getPCoh

public double getPCoh()
Overrides:
getPCoh in class Stats

getCompositionality

public double getCompositionality()

updateCoherence

public void updateCoherence(double x,
                            double y)
Specified by:
updateCoherence in class Stats

updateCoherence

public void updateCoherence(double x,
                            double y,
                            double z)

getUpdate

public boolean getUpdate()
Overrides:
getUpdate in class Stats