|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--LGames.Agent | +--LGames.HolisticAgent
The HolisticAgent class implements the structure and behaviours of the holistic agent with only one layer in the conceptual space.
Copyright (c) 2004 Paul Vogt
Field Summary | |
protected int |
DG
|
protected double |
eta
|
protected double |
etaN
|
protected double |
etaS
|
protected int |
gamesPlayed
|
protected int |
iMeaning
|
protected int |
iSymbols
|
protected java.util.List |
lexicon
|
protected int |
lg
|
protected double[][] |
lScore
|
protected int[][] |
lUse
|
protected int |
maxMeanings
|
protected int |
maxNSymbols
|
protected java.lang.String |
mString
|
protected int |
nMeanings
|
protected int |
nrDGSuccess
|
protected int |
nSymbols
|
protected java.util.List |
ontology
|
protected double |
thresholdForgetting
|
protected double |
thresholdForgettingS
|
protected int |
utteranceID
|
Fields inherited from class LGames.Agent |
age, cxt, dimension, id, topic, TOPIC, topicID, utterance |
Constructor Summary | |
HolisticAgent()
|
|
HolisticAgent(int n,
int a,
double e,
double s,
char u,
int nM,
int nS,
boolean[] fv)
Constucts an agent with identity n |
Method Summary | |
void |
adaptLexiconHearer(Symbols u,
int T,
char type,
char utype)
Adaptation function for the hearer |
void |
adaptLexiconSpeaker(Symbols u,
int T,
char type,
char utype)
Adaptation function for the speaker |
double |
calcInterpretationCoherence(HolisticAgent hearer,
int nMeanings)
Function for an artificially created lexicon. |
double |
calcProductionCoherence(HolisticAgent hearer,
int nMeanings)
Function for an artificially created lexicon. |
protected boolean |
context_member(int id)
Function to check whether a category relates to an object in the context |
void |
createArtificialLexicon(int nMeanings)
Function for an artificially created lexicon. |
void |
createArtificialOntology(int nMeanings)
Function for an artificially created lexicon. |
void |
forget(char type)
This function implements the search for elements that can be forgotten based on their effectiveness |
protected void |
forget(char type,
char rc,
int n)
This function implements the removal of categories or symbols in case of forgetting. |
int |
getDim()
Returns the dimensionality of the feature/conceptual space |
double |
getDS()
|
java.lang.String |
getGame()
Constructs a string that can be written to the logfile |
int |
getLexSize()
|
java.lang.String |
getMeaning(java.lang.String word,
char type)
This function is used to find the meaning that best fits a given word. |
double[][] |
getMeanings(java.lang.String w,
char t)
Function used to construct a matrix representation of meanings of word w. |
int |
getOntSize()
|
Meaning |
getTOPIC()
returns the topic's meaning. |
java.lang.String[] |
getWords()
Used to form the lexicon for the UI |
void |
getWords(java.util.List bag)
This function is used to produce a bag of words that are used by the entire population |
Symbols |
guess(Symbols u,
char utype)
This function processes the interpretation of the hearer for the guessing and selfish game. |
Symbols |
hear(Symbols u,
char type)
This function processes the interpretation of the hearer for the observational game. |
void |
merge(int dim,
char type)
This function implements the merging of meanings. |
void |
playDGame(char type,
char uType,
boolean b)
This function is not implemented... |
void |
playDGame(char type,
char uType,
int n,
boolean adapt)
This function lets the agent play a discrimination game |
void |
print()
prints the final language game. |
void |
print(java.io.PrintWriter outfile,
char type)
This function prints the ontology and lexicon of the agent to a file |
void |
printScore(java.io.PrintWriter outfile,
char type,
java.lang.String u,
int lg)
prints the score of string u to the outfile |
void |
setTopic(int t)
specifies which element in the context is the topic. |
void |
setTopicID(int t)
Sets some topic value, used in a test function. |
void |
setTOPICID(int t)
Sets some topic value, used in a test function. |
Symbols |
speak(double probability,
char type)
This function produces an utterance for the speaker |
Methods inherited from class LGames.Agent |
getAge, getFV, getID, getLabels, getMaxLayer, getTopic, getUtterance, initDGame, initialise, playDGame, printLexiconColumns, printLexiconLatexTabel, setContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List ontology
protected java.util.List lexicon
protected int maxMeanings
protected int maxNSymbols
protected int[][] lUse
protected double[][] lScore
protected int iSymbols
protected int iMeaning
protected int nMeanings
protected int nSymbols
protected int nrDGSuccess
protected int DG
protected int utteranceID
protected double eta
protected double etaS
protected double etaN
protected java.lang.String mString
protected final double thresholdForgetting
protected final double thresholdForgettingS
protected int gamesPlayed
protected int lg
Constructor Detail |
public HolisticAgent()
public HolisticAgent(int n, int a, double e, double s, char u, int nM, int nS, boolean[] fv)
n
- the identity of the agenta
- the agent's `birthdate' (i.e. language game nr.)e
- the standard learning rate etas
- the learning rate eta for the speakers in case we wish to distinguishu
- the type score-updatenM
- the memory size for meaningsnS
- the memory size for symbolsfv
- the array of features that were selectedMethod Detail |
public void setTopicID(int t)
public void setTOPICID(int t)
public void setTopic(int t)
setTopic
in class Agent
t
- the topic number to be setpublic Meaning getTOPIC()
getTOPIC
in class Agent
protected void forget(char type, char rc, int n)
forget
in class Agent
type
- type of the game that is being playedrc
- indicates whether it concerns a category (o) or symbol (otherwise)n
- the index of the element to be removedpublic void forget(char type)
forget
in class Agent
type
- type of game that is being playedpublic int getLexSize()
public int getOntSize()
public Symbols speak(double probability, char type)
speak
in class Agent
probability
- The word-creation probabilitytype
- The way the scores are updated ('s' for score-based, 'u' for usage-based)
public Symbols hear(Symbols u, char type)
hear
in class Agent
u
- The Symbols representation of the speaker's utterance
public Symbols guess(Symbols u, char utype)
guess
in class Agent
u
- The Symbols representation of the speaker's utteranceutype
- The way scores are adapted ('s' for score-based, 'u' for usage-based)
protected boolean context_member(int id)
context_member
in class Agent
id
- ID of the category to be checked.
public void adaptLexiconSpeaker(Symbols u, int T, char type, char utype)
adaptLexiconSpeaker
in class Agent
u
- utterance of the hearerT
- the topictype
- the type of gameutype
- the score-update typepublic void adaptLexiconHearer(Symbols u, int T, char type, char utype)
adaptLexiconHearer
in class Agent
u
- utterance of the speakerT
- the topictype
- the type of gamepublic void playDGame(char type, char uType, boolean b)
playDGame
in class Agent
type
- the type of gameuType
- the type of update score- or usage-basedb
- boolean to indicate whether or not to adapt the ontologypublic void playDGame(char type, char uType, int n, boolean adapt)
playDGame
in class Agent
type
- not useduType
- type of method with prototypes are shifted (default: centre-of-mass)n
- language game numberadapt
- wether or not the learning is on or off.public void merge(int dim, char type)
merge
in class Agent
dim
- number of dimensionstype
- score-update typepublic double getDS()
getDS
in class Agent
public void print()
print
in class Agent
public java.lang.String getGame()
getGame
in class Agent
public void print(java.io.PrintWriter outfile, char type)
print
in class Agent
outfile
- The file to which the data is writtentype
- score-update typepublic void printScore(java.io.PrintWriter outfile, char type, java.lang.String u, int lg)
printScore
in class Agent
outfile
- The file to which the data is writtentype
- the type of update (score- or usage-based)u
- the word of the lexical entrylg
- the language game numberpublic void getWords(java.util.List bag)
getWords
in class Agent
public java.lang.String[] getWords()
getWords
in class Agent
public int getDim()
Agent
getDim
in class Agent
public java.lang.String getMeaning(java.lang.String word, char type)
getMeaning
in class Agent
public double[][] getMeanings(java.lang.String w, char t)
getMeanings
in class Agent
w
- the word under considerationt
- score-update type
public void createArtificialLexicon(int nMeanings)
public void createArtificialOntology(int nMeanings)
public double calcProductionCoherence(HolisticAgent hearer, int nMeanings)
public double calcInterpretationCoherence(HolisticAgent hearer, int nMeanings)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |