|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.fuzzyTree.ScoreGenerator
Creates scores from an tree of DataNode
s. Nodes are assigned
scores based on how desirable they are to be displayed. A node's score
is the product of the size of the subtree of which it is the root and the number
of subtrees isomorphic to it, plus some additional parameters. A list that is
sorted based on these scores is the final product.
Field Summary | |
private DataGraph |
_dataGraph
Reference to the XML data graph |
private int |
_maxInitialScore
Used in preprocessing; the highest score value. |
private int |
_minInitialScore
Used in preprocessing; the lowest score value. |
private java.util.ArrayList |
_sortedNodeList
A sorted list of all of the DataNode s in the DataGraph . |
private java.util.ArrayList |
_tempNodeList
An ArrayList of ArrayList of DataNode s. |
java.util.Comparator |
descendingScoreComparator
Comparator for sorting on descending order of score |
static int |
MIN_NODE_SCORE
The minimum score value that a node may have. |
Constructor Summary | |
ScoreGenerator(DataGraph dataGraph)
Creates a score processor using dataGraph , performs all processing and
creates a sorted node list, which can be retrieved using getSortedNodeList() . |
Method Summary | |
private void |
addToList(DataNode node,
int i)
Inserts node into the height-i list |
private int |
calculateHeightAndCreateLists(DataNode root)
Calculates the height of each node, puts nodes in lists based on height. |
private void |
createEquivalenceClasses()
Creates equivalance classes for nodes based on an isomormphism index ordering. |
java.util.ArrayList |
getSortedNodeList()
Returns an ArrayList of DataNode s that are sorted in
descending order of score |
void |
printLists(java.io.PrintWriter out)
For debugging. |
private void |
setInitialScores(int startIndex,
int onePastEndIndex)
Sets the initial scores of nodes in _sortedNodeIndex from
startIndex to onePastEndIndex , which mark the start and end
of one equivalence class in _sortedNodeList . |
private void |
setRankNodeScores()
Changes initial scores in the list so that the first element of each equivalence class has the highest score, and the next element's score is less than the score of any first element in equivalance class, and so on. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private DataGraph _dataGraph
private java.util.ArrayList _tempNodeList
ArrayList
of ArrayList
of DataNode
s.
_tempNodeList[i]
contains nodes which have height i
.private int _maxInitialScore
private int _minInitialScore
public static final int MIN_NODE_SCORE
private java.util.ArrayList _sortedNodeList
DataNode
s in the DataGraph
.
Nodes are sorted based on the score field.public java.util.Comparator descendingScoreComparator
Constructor Detail |
public ScoreGenerator(DataGraph dataGraph)
dataGraph
, performs all processing and
creates a sorted node list, which can be retrieved using getSortedNodeList()
.Method Detail |
public java.util.ArrayList getSortedNodeList()
ArrayList
of DataNode
s that are sorted in
descending order of scoreprivate void createEquivalenceClasses()
IsomorphicDataNodeComparator
private void setInitialScores(int startIndex, int onePastEndIndex)
_sortedNodeIndex
from
startIndex
to onePastEndIndex
, which mark the start and end
of one equivalence class in _sortedNodeList
.
Initial score is the product of the equivlance class size and the tree size corresponding to the class.
startIndex
- starting index of a new equivalence classonePastEndIndex
- 1 + the index of the last member of the equivalence classprivate void setRankNodeScores()
(equivlance class number, rank in equivalance class)
(1, 1) (2, 1) (3, 1) (1, 2) (2, 2) (3, 2)
private int calculateHeightAndCreateLists(DataNode root)
Function is called recursively.
root
- the root of the subtreeprivate void addToList(DataNode node, int i)
node
into the height-i listnode
- the node to insert into a height listi
- the height of nodepublic void printLists(java.io.PrintWriter out)
out
only if FuzzyTreeModel.debugLevel < 5
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |