|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--edu.vt.marian.search.LinkSuperclassManager
Class manager for a link class that functions only as the union of disjoint subclasses. This is the only sort of superclass manager supported by MARIAN v.2.1.
The algorithm for each method is the same: create a MergeSequencer for merging results. (We use a MergeSequencer rather than a PriQueuSequencer because class hierarchies are designed by humans and thus each superclass is only expected to combine a handful of subclasses.) Call each subclass manager in turn, and feed the results into the Sequencer. Calls for statistics work the same way, but use totals and averages in place of Sequencers.
ClassManager,
LinkClassManager,
MergeSequencer| Field Summary | |
protected edu.vt.marian.common.ClassID |
classID
The class of links that this can manage. |
protected edu.vt.marian.common.Debug |
debug
|
protected java.util.Vector |
subclassMgrs
Vector of LinkClassManagers for the (disjoint) subclasses. |
| Constructor Summary | |
LinkSuperclassManager(edu.vt.marian.common.ClassID linkClID,
java.util.Vector subclassManagers,
edu.vt.marian.common.Debug d)
Create a LinkClassManager for a particular superclass of disjoint (link) subclasses. |
|
| Method Summary | |
double |
avgSinkDegree()
Return the average number of links in this class that impinge on a sinknode currently (== numLinks / numSinks). |
double |
avgSourceDegree()
Return the average number of links in this class that impinge on a source node currently (== numLinks / numSources). |
long |
classSize()
Return the number of class instances currently in the factory. |
WtdObjSet |
keyNodeToTargetSet(edu.vt.marian.common.WtdObj key,
int dir)
Take a single node on one end of this link to all the nodes at the other end. |
WtdObjSet |
keySetToTargetSet(WtdObjSet keySet,
int dir)
Take a weighted object set of nodes on one end of the links in this class to all the nodes at the other end. |
WtdObjSet |
match(edu.vt.marian.common.LinkDesc description)
Create (or find in the local cache) a set of matches to description. |
long |
numLinks()
Return the number of class instances currently in the factory. |
long |
numSinks()
Return the number of unique sink nodes currently in the factory. |
long |
numSources()
Return the number of unique source nodes currently in the factory. |
WtdObjSet |
sinksToSources(WtdObjSet sinkSet)
Syntactic sugar on keySetToTargetSet(). |
WtdObjSet |
sinkToSources(edu.vt.marian.common.WtdObj sinkNode)
Syntactic sugar on keyNodeToTargetSet(). |
WtdObjSet |
sourcesToSinks(WtdObjSet sourceSet)
Syntactic sugar on keySetToTargetSet(). |
WtdObjSet |
sourceToSinks(edu.vt.marian.common.WtdObj sourceNode)
Syntactic sugar on keyNodeToTargetSet(). |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected edu.vt.marian.common.Debug debug
protected edu.vt.marian.common.ClassID classID
protected java.util.Vector subclassMgrs
| Constructor Detail |
public LinkSuperclassManager(edu.vt.marian.common.ClassID linkClID,
java.util.Vector subclassManagers,
edu.vt.marian.common.Debug d)
| Method Detail |
public WtdObjSet match(edu.vt.marian.common.LinkDesc description)
description - An abstract description of the links
we're looking for: specifically, the
link class (presumably this.classID),
the direction, and a description of what
is on one end.
public WtdObjSet keyNodeToTargetSet(edu.vt.marian.common.WtdObj key,
int dir)
key - The node as a WtdObj.dir - Whether key functions as source or sink.
public WtdObjSet keySetToTargetSet(WtdObjSet keySet,
int dir)
NOTE: Where two nodes in keySet are both linked to the same "target" node, some function must be applied to compute the node's weight in the combined set. The default for links is max(), but any implementing LinkClassManager class may use any function that suits its semantics.
key - the node as a WtdObj.dir - Whether key functions as source or sink.public WtdObjSet sourceToSinks(edu.vt.marian.common.WtdObj sourceNode)
public WtdObjSet sourcesToSinks(WtdObjSet sourceSet)
public WtdObjSet sinkToSources(edu.vt.marian.common.WtdObj sinkNode)
public WtdObjSet sinksToSources(WtdObjSet sinkSet)
public long numLinks()
public long numSources()
public long numSinks()
public double avgSourceDegree()
public double avgSinkDegree()
public long classSize()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||