|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--LGames.Agent
|
+--LGames.HolisticAgent2
The HolisticAgent2 class implements the structure and behaviours of the holistic agent with a hierarchical structure 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 | |
HolisticAgent2()
Empty constructor |
|
HolisticAgent2(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(HolisticAgent2 hearer,
int nMeanings)
Function for an artificially created lexicon. |
double |
calcProductionCoherence(HolisticAgent2 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 |
getLayer()
|
int |
getLexSize()
|
int |
getMaxLayer()
|
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()
|
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, used to save the lexicon in of the different formats |
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 |
initDGame()
Initialises the discrimination 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 l,
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 |
setTopicID(int t)
Sets the topicID and its meaning, used in a test function. |
void |
setTOPICID(int t)
Sets the topicID and an utterance ID, 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, getTopic, getTOPIC, getUtterance, initialise, playDGame, printLexiconColumns, printLexiconLatexTabel, setContext, setTopic |
| 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 HolisticAgent2()
public HolisticAgent2(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 selected| Method Detail |
public void setTopicID(int t)
public void setTOPICID(int t)
protected void forget(char type,
char rc,
int n)
forget in class Agenttype - 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 Agenttype - type of game that is being playedpublic int getLexSize()
public int getOntSize()
public Symbols speak(double probability,
char type)
speak in class Agentprobability - 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 Agentu - The Symbols representation of the speaker's utterancetype - The score-update type
public Symbols guess(Symbols u,
char utype)
guess in class Agentu - 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 Agentid - ID of the category to be checked.
public void adaptLexiconSpeaker(Symbols u,
int T,
char type,
char utype)
adaptLexiconSpeaker in class Agentu - utterance of the hearerT - the topictype - the type of gameutype - the score-update type
public void adaptLexiconHearer(Symbols u,
int T,
char type,
char utype)
adaptLexiconHearer in class Agentu - utterance of the speakerT - the topictype - the type of gameutype - the score-update type
public void playDGame(char type,
char uType,
boolean b)
playDGame in class Agenttype - the type of gameuType - the type of update score- or usage-basedb - boolean to indicate whether or not to adapt the ontology
public void playDGame(char type,
char uType,
int l,
int n,
boolean adapt)
playDGame in class Agenttype - not useduType - type of method with prototypes are shifted (default: centre-of-mass)l - hierarchical layern - language game numberadapt - wether or not the learning is on or off.public void initDGame()
initDGame in class Agentpublic int getMaxLayer()
getMaxLayer in class Agentpublic int getLayer()
public void merge(int dim,
char type)
merge in class Agentdim - number of dimensionstype - score-update typepublic double getDS()
getDS in class Agentpublic void print()
print in class Agentpublic java.lang.String getGame()
getGame in class Agent
public void print(java.io.PrintWriter outfile,
char type)
print in class Agentoutfile - The file to which the data is writtentype - the type of update (score- or usage-based)
public void printScore(java.io.PrintWriter outfile,
char type,
java.lang.String u,
int lg)
printScore in class Agentoutfile - 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 Agentpublic java.lang.String[] getWords()
getWords in class Agentpublic 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 Agentw - the word under considerationt - score-update type
public void createArtificialLexicon(int nMeanings)
public void createArtificialOntology(int nMeanings)
public double calcProductionCoherence(HolisticAgent2 hearer,
int nMeanings)
public double calcInterpretationCoherence(HolisticAgent2 hearer,
int nMeanings)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||