|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable
edu.mit.sketch.ddg.ConstraintGraph
public class 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.
Classes that use this graph should also be careful to maintain this property.
| Constructor Summary | |
|---|---|
ConstraintGraph()
|
|
| Method Summary | |
|---|---|
void |
addEdge(ConstraintGraphEdge edge)
Add an edge between two given primitives. |
void |
addEdge(Primitive p1,
Primitive p2,
double confidence,
double relevance)
Add an edge between two given primitives. |
java.lang.Object |
clone()
Clone the graph |
double |
confidence(Primitive p1,
Primitive p2)
Return the confidence of the constraint. |
boolean |
containsEdge(Primitive p1,
Primitive p2)
Returns true if the graph contains an edge between the given primitives. |
ConstraintGraphEdgeList |
edgeList()
Return the list of edges in the current constraint graph. |
ConstraintGraphEdgeList |
edgeList(Constraint constraint)
Return the list of edges in the current constraint graph labelled with the name of a constraint. |
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. |
PrimitiveList |
primitiveList()
Return the list of primitives in the current constraint graph. |
void |
print(java.io.PrintStream out,
boolean printDetails)
Print the constraint graph to the given output stream. |
double |
relevance(Primitive p1,
Primitive p2)
Return the relevance of the constraint between two given primitives. |
boolean |
removeEdge(Primitive p1,
Primitive p2)
Remove and edge between two given primitives and return true. |
boolean |
sameAs(ConstraintGraph other,
PrimitiveMapping mapping)
Verifies whether this constraint is the same as the other one given the mapping between primitives. |
void |
setConfidence(Primitive p1,
Primitive p2,
double confidence)
Change the confidence of the constraint between two given primitives. |
void |
setRelevance(Primitive p1,
Primitive p2,
double relevance)
Change the relevance of the constraint between two given primitives. |
| Methods inherited from class java.util.Hashtable |
|---|
clear, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConstraintGraph()
| Method Detail |
|---|
public ConstraintGraphEdgeList getOutgoingEdges(Primitive p1)
throws PrimitiveNotFoundException
PrimitiveNotFoundException
public ConstraintGraphEdgeList getIncomingEdges(Primitive p2)
throws PrimitiveNotFoundException
PrimitiveNotFoundException
public ConstraintGraphEdge getEdge(Primitive p1,
Primitive p2)
throws EdgeNotFoundException
EdgeNotFoundException
public void addEdge(Primitive p1,
Primitive p2,
double confidence,
double relevance)
public void addEdge(ConstraintGraphEdge edge)
public boolean removeEdge(Primitive p1,
Primitive p2)
public boolean containsEdge(Primitive p1,
Primitive p2)
public void print(java.io.PrintStream out,
boolean printDetails)
public double relevance(Primitive p1,
Primitive p2)
public double confidence(Primitive p1,
Primitive p2)
public void setRelevance(Primitive p1,
Primitive p2,
double relevance)
throws EdgeNotFoundException
EdgeNotFoundException
public void setConfidence(Primitive p1,
Primitive p2,
double confidence)
throws EdgeNotFoundException
EdgeNotFoundExceptionpublic ConstraintGraphEdgeList edgeList()
public ConstraintGraphEdgeList edgeList(Constraint constraint)
public PrimitiveList primitiveList()
public java.lang.Object clone()
clone in class java.util.Hashtable
public boolean sameAs(ConstraintGraph other,
PrimitiveMapping mapping)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||