edu.vt.marian.search
Interface LinkClassManager

All Known Implementing Classes:
LinkSuperclassManager, WtdLinkClassManager, UnwtdLinkClassManager

public abstract interface LinkClassManager
extends ClassManager

Class Manager for link objects. Since links are entirely determined by their classID and the nodes at each end, matching and searching methods are concerned with moving from a node or WtdObjSet of nodes at one end of the link to the WtdObjSet of nodes at the other end.

See Also:
ClassManager, NodeClassManager, LinkDesc, WtdObjSet

Fields inherited from class edu.vt.marian.search.ClassManager
ALREADY_EXISTS, NO_SUCH_OBJECT
 
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).
 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 interface edu.vt.marian.search.ClassManager
classSize
 

Method Detail

match

public WtdObjSet match(edu.vt.marian.common.LinkDesc description)
Create (or find in the local cache) a set of matches to description.
Parameters:
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.
Returns:
a WtdObjSet of nodes on the other end.

keyNodeToTargetSet

public 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.
Parameters:
key - The node as a WtdObj.
dir - Whether key functions as source or sink.
Returns:
The set of all nodes linked to key by instances of this link class, weighted by link weights (if any) and key.wt().

keySetToTargetSet

public 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.

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.

Parameters:
key - the node as a WtdObj.
dir - Whether key functions as source or sink.
Returns:
The set of all nodes linked to any node in keySet by instances of this link class, weighted by link weights (if any) and key.wt().

sourceToSinks

public WtdObjSet sourceToSinks(edu.vt.marian.common.WtdObj sourceNode)
Syntactic sugar on keyNodeToTargetSet().

sourcesToSinks

public WtdObjSet sourcesToSinks(WtdObjSet sourceSet)
Syntactic sugar on keySetToTargetSet().

sinkToSources

public WtdObjSet sinkToSources(edu.vt.marian.common.WtdObj sinkNode)
Syntactic sugar on keyNodeToTargetSet().

sinksToSources

public WtdObjSet sinksToSources(WtdObjSet sinkSet)
Syntactic sugar on keySetToTargetSet().

numLinks

public long numLinks()
Return the number of class instances currently in the factory. Syntactic sugar on super.classSize().

numSources

public long numSources()
Return the number of unique source nodes currently in the factory.

numSinks

public long numSinks()
Return the number of unique sink nodes currently in the factory.

avgSourceDegree

public double avgSourceDegree()
Return the average number of links in this class that impinge on a source node currently (== numLinks / numSources).

avgSinkDegree

public double avgSinkDegree()
Return the average number of links in this class that impinge on a sinknode currently (== numLinks / numSinks).