|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--LGames.Agent
The Agent class implements the agent's structure and behaviours. It is constructed, initialised and controlled from the thsim main class.
Copyright (c) 2004 Paul Vogt
Field Summary | |
protected int |
age
|
protected Context |
cxt
|
protected int |
DG
|
protected int |
dimension
|
protected int |
id
|
protected int |
nrDGSuccess
|
protected int |
topic
|
protected Meaning |
TOPIC
|
protected int |
topicID
|
protected Symbols |
utterance
|
Constructor Summary | |
Agent()
|
|
Agent(int n,
int a,
double e,
double s)
Constucts an agent with identity n |
|
Agent(int n,
int a,
double e,
double s,
int m,
int M)
|
Method Summary | |
abstract void |
adaptLexiconHearer(Symbols u,
int T,
char type,
char utype)
Adaptation function for the hearer |
abstract void |
adaptLexiconSpeaker(Symbols u,
int T,
char type,
char utype)
Adaptation function for the speaker |
protected boolean |
context_member(int id)
Function to check whether a category relates to an object in the context |
protected abstract void |
forget(char type)
This function implements the search for elements that can be forgotten based on their effectiveness |
protected abstract void |
forget(char type,
char rc,
int n)
This function implements the removal of categories or symbols in case of forgetting. |
int |
getAge()
returns the age of the agent |
int |
getDim()
Returns the dimensionality of the feature/conceptual space |
double |
getDS()
|
double[] |
getFV()
Returns the feature vector of the topic |
abstract java.lang.String |
getGame()
Constructs a string that can be written to the logfile |
int |
getID()
Returns the agent's id |
java.lang.String |
getLabels()
Returns a string representation of the features that are selected. |
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)
This function returns a matrix representation for the meanings of word w and is used for the UI showLexicon |
int |
getTopic()
Returns the integer value of the topic |
Meaning |
getTOPIC()
Returns the pointer to the topic |
java.lang.String |
getUtterance()
Returns the utterance produced by the speaker or interpreted by the hearer. |
java.lang.String[] |
getWords()
This function returns a String array with all the words, used for the UI showLexicon |
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. |
abstract Symbols |
hear(Symbols u,
char type)
This function processes the interpretation of the hearer for the observational game. |
void |
initDGame()
Initialise the discrimination game. |
void |
initialise()
Used to initialise some settings for testing |
void |
merge(int dim,
char type)
This function implements the merging of meanings. |
abstract void |
playDGame(char type,
char uType,
boolean adapt)
This function lets the agent play a discrimination game |
void |
playDGame(char type,
char uType,
int layer,
boolean adapt)
This function lets the hierarchical agent play a discrimination game |
void |
playDGame(char type,
char uType,
int layer,
int n,
boolean adapt)
This function lets the hierarchical agent play a discrimination game |
void |
print()
Prints "AgentN", where N is the agent's id |
void |
print(java.io.PrintWriter outfile,
char type)
This function prints the ontology and lexicon of the agent to a file |
void |
printLexiconColumns(java.io.PrintWriter ofile,
char type,
int lg)
prints the lexicon as in columns |
void |
printLexiconLatexTabel(java.io.PrintWriter ofile,
char type,
int lg)
prints the lexicon as a table |
void |
printScore(java.io.PrintWriter outfile,
char type,
java.lang.String u,
int lg)
prints the scores of the lexical entry specified by u |
void |
setContext(Context C,
double noise)
Sets the context to C and adds noise |
void |
setTopic(int t)
Sets the topic to the value t |
abstract Symbols |
speak(double probability,
char type)
This function produces an utterance for the speaker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int id
protected Context cxt
protected int nrDGSuccess
protected int DG
protected int topic
protected Symbols utterance
protected Meaning TOPIC
protected int topicID
protected int age
protected int dimension
Constructor Detail |
public Agent()
public Agent(int n, int a, double e, double s)
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 distinguishpublic Agent(int n, int a, double e, double s, int m, int M)
Method Detail |
public void initialise()
public void setContext(Context C, double noise)
C
- the contextnoise
- the perceptual noisepublic int getTopic()
public void setTopic(int t)
t
- the topic number to be setpublic double[] getFV()
public Meaning getTOPIC()
public int getID()
public int getDim()
public int getAge()
public java.lang.String getUtterance()
public java.lang.String getLabels()
Context.getLabels()
protected abstract void forget(char type, char rc, int n)
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 removedprotected abstract void forget(char type)
type
- type of game that is being playedpublic abstract Symbols speak(double probability, char type)
probability
- The word-creation probabilitytype
- The type of game being played ('s' - selfish game,
'g' - guessing game, 'o' - observational game)
public abstract Symbols hear(Symbols u, char type)
u
- The Symbols representation of the speaker's utterance
public Symbols guess(Symbols u, char utype)
u
- The Symbols representation of the speaker's utterance
protected boolean context_member(int id)
id
- ID of the category to be checked.
public abstract void adaptLexiconSpeaker(Symbols u, int T, char type, char utype)
u
- utterance of the hearerT
- the topictype
- the type of gamepublic abstract void adaptLexiconHearer(Symbols u, int T, char type, char utype)
u
- utterance of the speakerT
- the topictype
- the type of gamepublic abstract void playDGame(char type, char uType, boolean adapt)
type
- the type of gameuType
- the type of update score- or usage-basedadapt
- boolean to indicate whether or not to adapt the ontologypublic void playDGame(char type, char uType, int layer, boolean adapt)
type
- the type of gameuType
- the type of update score- or usage-basedlayer
- the layer at which the game is playedadapt
- boolean to indicate whether or not to adapt the ontologypublic void playDGame(char type, char uType, int layer, int n, boolean adapt)
type
- the type of gameuType
- the type of update score- or usage-basedlayer
- the layer at which the game is playedn
- language game numberadapt
- boolean to indicate whether or not to adapt the ontologypublic void initDGame()
public int getMaxLayer()
public void merge(int dim, char type)
public double getDS()
public void print()
public abstract java.lang.String getGame()
public void print(java.io.PrintWriter outfile, char type)
outfile
- The file to which the data is writtentype
- the type of update (score- or usage-based)public void printLexiconLatexTabel(java.io.PrintWriter ofile, char type, int lg)
type
- the type of update (score- or usage-based)lg
- the language game numberpublic void printLexiconColumns(java.io.PrintWriter ofile, char type, int lg)
type
- the type of update (score- or usage-based)lg
- the language game numberpublic void printScore(java.io.PrintWriter outfile, char type, java.lang.String u, int lg)
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)
public java.lang.String[] getWords()
public java.lang.String getMeaning(java.lang.String word, char type)
public double[][] getMeanings(java.lang.String w, char t)
w
- the wordt
- type of score-update
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |