|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--edu.mit.sketch.ddg.ConstraintGraph
A hashtable that stores the graph for a constraint of a particular type (like "connects"). If a constraint holds between to primitives (nodes in the graph), there will be an edge (ConstraintGraphEdge) between them. The edge also stores the confidence that the constraint holds and the importance of the constraint. The keys of the Hashtable are Primitives and the values are a list of outgoing directed edges (ConstraintGraphEdgeList).
Note: If the constraint is just a property of one primitive, it will have a self loop in the
constraint graph.
If a primitive does not participate in the constraint at all, it will not be in the hashtable.
| Inner classes inherited from class java.util.Map |
Map.Entry |
| Constructor Summary | |
ConstraintGraph()
|
|
| Method Summary | |
void |
addEdge(Primitive p1,
ConstraintGraphEdge edge)
Add an outgoing edge from a given primitive |
void |
addEdge(Primitive p1,
Primitive p2,
double confidence,
double relevance)
Add an edge between two given primitives. |
double |
confidence(Primitive p1,
Primitive p2)
Return the confidence of the constraint Returns 0 if the edge is not present. |
boolean |
containsEdge(Primitive p1,
Primitive p2)
Returns true if the graph contains an edge between the given primitives. |
Vector |
edgeList()
Return the list primitive pairs for which this constraint holds. |
ConstraintGraphEdge |
getEdge(Primitive p1,
Primitive p2)
Get edge between the two given primitives. |
ConstraintGraphEdgeList |
getIncomingEdges(Primitive p2)
Get the list of incoming edges for a given primitive. |
ConstraintGraphEdgeList |
getOutgoingEdges(Primitive p1)
Get the list of outgoing edges for a given primitive. |
void |
print()
Print the constraint graph |
double |
relevance(Primitive p1,
Primitive p2)
Return the relevance of the constraint Returns 0 if the edge is not present. |
ConstraintGraphEdge |
removeEdge(Primitive p1,
Primitive p2)
Remove and edge between two given primitives and return it. |
void |
setConfidence(Primitive p1,
Primitive p2,
double confidence)
Change the confidence of the constraint |
void |
setRelevance(Primitive p1,
Primitive p2,
double relevance)
Change the relevance of the constraint |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ConstraintGraph()
| Method Detail |
public ConstraintGraphEdgeList getOutgoingEdges(Primitive p1)
public ConstraintGraphEdgeList getIncomingEdges(Primitive p2)
public void addEdge(Primitive p1,
Primitive p2,
double confidence,
double relevance)
public void addEdge(Primitive p1,
ConstraintGraphEdge edge)
public ConstraintGraphEdge getEdge(Primitive p1,
Primitive p2)
public ConstraintGraphEdge removeEdge(Primitive p1,
Primitive p2)
public boolean containsEdge(Primitive p1,
Primitive p2)
public void print()
public double relevance(Primitive p1,
Primitive p2)
public double confidence(Primitive p1,
Primitive p2)
public void setRelevance(Primitive p1,
Primitive p2,
double relevance)
public void setConfidence(Primitive p1,
Primitive p2,
double confidence)
public Vector edgeList()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||