|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--saffron.opt.RuleQueue
Priority queue of relexps whose rules have not been called, and rule-matches which have not yet been acted upon.
Nested Class Summary | |
private class |
RuleQueue.RelImportanceComparator
Compares Rel objects according to their cached 'importance'. |
private class |
RuleQueue.RuleMatchImportanceComparator
Compares RuleMatch objects according to their importance. |
Field Summary | |
private ArrayList |
matchList
|
private HashSet |
matchNames
|
private VolcanoPlanner |
planner
|
private Comparator |
relImportanceComparator
Compares relexps according to their cached 'importance'. |
private BinaryHeap |
relQueue
|
private HashSet |
rels
|
private Comparator |
ruleMatchImportanceComparator
|
(package private) HashMap |
subsetImportances
Maps RelSubset to Double . |
Constructor Summary | |
(package private) |
RuleQueue(VolcanoPlanner planner)
|
Method Summary | |
(package private) void |
add(Rel rel)
Registers that a relational expression's rules have not been fired. |
(package private) void |
add(RelSubset subset)
Registers a subset, if it has not already been registered. |
(package private) void |
addMatch(RuleMatch match)
Adds a rule match. |
(package private) double |
computeImportance(RelSubset subset)
Computes the importance of a node. |
private double |
computeImportanceOfChild(RelSubset child,
RelSubset parent)
Returns the importance of a child to a parent. |
boolean |
contains(Rel rel)
|
(package private) void |
dump()
|
(package private) Rel |
findCheapestMember(RelSubset childSubset)
|
double |
getImportance(RelSet set)
Computes the importance a set (which is that of its most important subset). |
(package private) double |
getImportance(RelSubset rel)
Returns the importance of an equivalence class of relational expressions. |
boolean |
hasNextMatch()
Returns whether there is a rule match in the queue. |
(package private) boolean |
isEmpty()
|
(package private) Rel |
pop()
Returns the relational expression whose cost is highest |
(package private) RuleMatch |
popMatch()
Removes the rule match with the highest importance, and returns it. |
void |
recompute(RelSubset subset)
|
(package private) boolean |
remove(Rel rel)
|
private double |
toDouble(Cost cost)
Converts a cost to a scalar quantity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final VolcanoPlanner planner
HashMap subsetImportances
RelSubset
to Double
.
private Comparator relImportanceComparator
private BinaryHeap relQueue
private HashSet rels
private final Comparator ruleMatchImportanceComparator
private final ArrayList matchList
private final HashSet matchNames
Constructor Detail |
RuleQueue(VolcanoPlanner planner)
Method Detail |
void add(Rel rel)
void add(RelSubset subset)
boolean remove(Rel rel)
boolean isEmpty()
Rel pop()
void dump()
double getImportance(RelSubset rel)
If a subset in the same set but with a different calling convention is deemed to be important, then this subset has at least half of its importance. (This rule is designed to encourage conversions to take place.)
double computeImportance(RelSubset subset)
RelSubset
has an importance of 1In = Sumparents p of n {Ip . Wn, p}where Wn, p, the weight of n within its parent p, is
Wn, p = Costn / (SelfCostp + Costn0 + ... + Costnk)
private double computeImportanceOfChild(RelSubset child, RelSubset parent)
private double toDouble(Cost cost)
Rel findCheapestMember(RelSubset childSubset)
public void recompute(RelSubset subset)
public boolean contains(Rel rel)
void addMatch(RuleMatch match)
RuleMatch popMatch()
public boolean hasNextMatch()
public double getImportance(RelSet set)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |