|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--ostore.introspect.SemanticDistanceModel.Table
The actual semantic distance table.
| Field Summary | |
|---|---|
static String |
class_tag
|
| Constructor Summary | |
|---|---|
SemanticDistanceModel.Table(InputBuffer buffer)
|
|
SemanticDistanceModel.Table(int bound,
Time now)
Constructor. |
|
| Method Summary | |
|---|---|
int |
getClients()
Get the number of clients represented by this model. |
Distance |
getDistance(QuickSerializable from,
QuickSerializable to)
Get the distance between observations from and
to. |
Iterator |
getDistances(QuickSerializable from)
Get a sorted iterator of the distances between from
and other types. |
Set |
getKeys()
Get the set of all observation types known. |
protected SemanticDistanceModel.BoundedPrioQueue |
getQueue(QuickSerializable key)
Get the queue of distances associated with key |
protected Time |
getTime(QuickSerializable key)
Get the last time we saw this observation |
void |
serialize(OutputBuffer buffer)
Add the object to the buffer. |
void |
setClients(int clients)
Set the number of clients represented by this model |
void |
setDistance(SemanticDistanceModel.Filter filter,
QuickSerializable from,
QuickSerializable to,
Distance d)
Explicitly set the distance between observation type from and to. |
void |
setMaxRelations(int num)
Set the maximum number of distances to keep for each observation type. |
protected void |
setTime(QuickSerializable key,
Time time)
Set the last time we saw this observation |
String |
toString()
Warning: this method takes O(n^2) time. |
void |
update(SemanticDistanceModel.Filter filter,
QSVector times)
Update the semantic distance table with the observations parameterized by type and time. |
protected void |
update(SemanticDistanceModel.Filter filter,
QuickSerializable key,
SemanticDistanceModel.BoundedPrioQueue oq,
Distance oage,
int oclients,
Time access_time)
Update one row of the semantic distance table with the distance values from the other table. |
void |
update(SemanticDistanceModel.Filter filter,
QuickSerializable type,
Time time)
Update the semantic distance table with the observation parameterized by type and time. |
void |
update(SemanticDistanceModel.Filter filter,
SemanticDistanceModel.Table other,
boolean save_times)
Update the semantic distance table with the distance values from the other table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String class_tag
| Constructor Detail |
public SemanticDistanceModel.Table(int bound,
Time now)
bound - the max number of relations per table row.now - the time this model was created.
public SemanticDistanceModel.Table(InputBuffer buffer)
throws QSException
| Method Detail |
public void serialize(OutputBuffer buffer)
QuickSerializablebuffer.
serialize in interface QuickSerializablebuffer - the output buffer to add the object to
public void update(SemanticDistanceModel.Filter filter,
QSVector times)
type and time.
filter - the filter used to recalculate the semantic distancetimes - new observations in a
Vector< QuickSerializable type, Time time >.
public void update(SemanticDistanceModel.Filter filter,
QuickSerializable type,
Time time)
type and time.
filter - the filter used to recalculate the semantic distancetype - the type of observationtime - the time it was observed
public void update(SemanticDistanceModel.Filter filter,
SemanticDistanceModel.Table other,
boolean save_times)
other table. This distances and age of the table
is updated -- the number of clients represented is NOT updated.
filter - the filter used to recalculate the semantic distanceother - the other table to incorporate values fromsave_times - save the latest access times from the other table
if they are more recent than the ones in our current table.
protected void update(SemanticDistanceModel.Filter filter,
QuickSerializable key,
SemanticDistanceModel.BoundedPrioQueue oq,
Distance oage,
int oclients,
Time access_time)
other table.
filter - the filter used to recalculate the semantic distancekey - the row to update (distances from this type)oq - the queue of new distancesoage - the age of the new distancesoclients - the number of clients represented by new distancesaccess_time - update the latest access time of this key to
this value if this value is > the last access time. If this value
is null, do not update the latest access time.public void setMaxRelations(int num)
num semantically
closest values for each observation type.
num - the new max number of distances.
public Distance getDistance(QuickSerializable from,
QuickSerializable to)
from and
to.
from - the type fromto - the type to
from to to
null if from is not a known type.public Iterator getDistances(QuickSerializable from)
from
and other types.
from - the type from
Iterator<Tuple> of the distances
between from and other types.
null if from is not a known type.protected Time getTime(QuickSerializable key)
key - the type of the observation
protected void setTime(QuickSerializable key,
Time time)
key - the type of the observationtime - the time to set it toprotected SemanticDistanceModel.BoundedPrioQueue getQueue(QuickSerializable key)
key
key - the type from
keypublic Set getKeys()
public void setDistance(SemanticDistanceModel.Filter filter,
QuickSerializable from,
QuickSerializable to,
Distance d)
from and to.
from - the from observation type.to - the to observation type.d - the distance to set it to.public void setClients(int clients)
public int getClients()
public String toString()
toString in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||