|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--LGames.Meaning
This class implements the representations of meanings. The meanings are represented as prototypes, an n-dimensional vector. The class controls the meaning and implements certain operations that can be performed on this representation.
Copyright (c) 2004 Paul Vogt
Field Summary | |
protected double |
alpha
|
protected int |
cover
|
protected double |
epsilon
|
protected double |
epsilonRegion
|
protected int |
ID
|
protected int |
layer
|
protected double[] |
prototype
|
protected double |
temperature
|
protected int |
use
|
Constructor Summary | |
Meaning()
Empty constructor |
|
Meaning(double[] fv,
int n)
Constructs a meaning with the given feature vector as the new prototype and id. |
|
Meaning(double[] fv,
int n,
int l)
Constructs a meaning with the given feature vector as the new prototype, an id and its hierarchical layer |
|
Meaning(double[] fv,
int n,
int c,
int l)
Constructs a meaning with the given feature vector as the new prototype, an id, its cover and its hierarchical layer. The cover also indicates on which dimensions the prototypes are added. |
|
Meaning(int id)
Constructs a dummy meaning with feature values of -100. |
|
Meaning(int[] dcs,
java.util.List o)
Constructs a meaning based on the categorical features specified in the dcs and given in the ontology o |
|
Meaning(int id,
int c)
Constructs a meaning used for testing. |
Method Summary | |
boolean |
comparePType(double[] c)
compares two prototypes (or possibly a feature vector) with each other. |
int |
elementOf(java.util.List o)
This function searches the index of this meaning in the ontology o |
boolean |
equals(Meaning m)
The function equals checks whether two meanings are equal. |
int |
getCover()
|
int |
getID()
|
int[] |
getkNN(java.util.List o,
int k)
This function returns the k-nearest neighbours of this meaning in the ontology o. |
int |
getLayer()
|
double[] |
getPrototype()
|
int |
getUse()
|
boolean |
inContext(Context cxt)
Checks whether the meaning is in the context. |
void |
increaseUse()
increases the usage counter by 1 |
int |
memberOf(java.util.List o)
Checks wether this meaning is a member of the ontology |
void |
merge(Meaning M)
if after shifting prototypes, two prototypes come within a certain Eucledian distance of each other, the two are merged. |
java.lang.String |
mstring()
returns a string representation of the meaning that is used for writing to the log file in the Stats class. |
void |
print()
Writes the meaning to the standard output |
void |
print(java.io.PrintWriter outfile)
Writes the meaning to a file |
void |
setID(int id)
|
void |
shift_prototype(double[] fv,
char updateType)
This function shifts each dimension of the prototype in the direction of the corresponding dimension of the feature vector. |
int |
similarDimensions(double[] x)
Calculates the cover of the similarity between the vector x and the prototype |
java.lang.String |
string()
Returns a string representation of the meaning. |
java.lang.String |
toString()
returns a string representation of the meaning that is used for writing to the log file in the Stats class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double[] prototype
protected int ID
protected final double epsilon
protected int use
protected final double alpha
protected double temperature
protected int cover
protected final double epsilonRegion
protected int layer
Constructor Detail |
public Meaning()
public Meaning(double[] fv, int n)
fv
- the feature vectorn
- the idpublic Meaning(double[] fv, int n, int l)
fv
- the feature vectorn
- the idl
- the layerpublic Meaning(double[] fv, int n, int c, int l)
fv
- the feature vectorn
- the idc
- the coverl
- the layerpublic Meaning(int id)
public Meaning(int[] dcs, java.util.List o)
public Meaning(int id, int c)
Method Detail |
public int getID()
public void setID(int id)
public double[] getPrototype()
public void increaseUse()
public int getUse()
public int getCover()
public int getLayer()
public int memberOf(java.util.List o)
o
- the ontology
public boolean equals(Meaning m)
m
- the second meaning
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String mstring()
public java.lang.String string()
public void shift_prototype(double[] fv, char updateType)
fv
- the feature vector.updateType
- specifies the way the prototypes are shifted. There is one that uses
a center-of-mass method, one uses simulated annealing and another a direct walkpublic void merge(Meaning M)
M
- the meaning to be merged.public boolean comparePType(double[] c)
c
- the prototype (feature vector) to be compared.
public void print()
public void print(java.io.PrintWriter outfile)
public boolean inContext(Context cxt)
cxt
- the context
public int similarDimensions(double[] x)
x
- the vector
public int[] getkNN(java.util.List o, int k)
o
- the ontologyk
- the number of nearest neighbours
public int elementOf(java.util.List o)
o
- the ontology
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |