Class DescribeGraph
Object
DescribeGraph
Builds string-descriptions of a
NeighborGraph
.
This class provides methods to generate string descriptions of a NeighborGraph
, its
vertices, edges, and potential merges.
-
Constructor Summary
ConstructorsConstructorDescriptionDescribeGraph
(NeighborGraph graph, boolean includePayload) Creates a newDescribeGraph
instance. -
Method Summary
Modifier and TypeMethodDescriptiondescribe()
Generates a string describing the entire graph (vertices and edges).describeEdge
(ObjectVertex source, ObjectVertex destination, ObjectVertex merged, double priority, boolean doMerge) Generates a string to describe a potential merge.describeMerge
(ObjectVertex merged, TypedEdge<ObjectVertex, PrioritisedVertex> bestImprovement) Describes a merge operation that has been decided upon.
-
Constructor Details
-
DescribeGraph
public DescribeGraph(NeighborGraph graph, boolean includePayload) Creates a newDescribeGraph
instance.- Parameters:
graph
- Graph theNeighborGraph
to describe.includePayload
- Whether to include payload values in the log messages.
-
-
Method Details
-
describe
Generates a string describing the entire graph (vertices and edges).- Returns:
- a multi-line string description of the graph
-
describeEdge
public String describeEdge(ObjectVertex source, ObjectVertex destination, ObjectVertex merged, double priority, boolean doMerge) Generates a string to describe a potential merge.- Parameters:
source
- the sourceObjectVertex
destination
- the destinationObjectVertex
merged
- the resulting mergedObjectVertex
priority
- the priority of the mergedoMerge
- whether the merge will be performed- Returns:
- a string description of the potential merge
-
describeMerge
public String describeMerge(ObjectVertex merged, TypedEdge<ObjectVertex, PrioritisedVertex> bestImprovement) Describes a merge operation that has been decided upon.- Parameters:
merged
- the resulting mergedObjectVertex
bestImprovement
- theTypedEdge
representing the best improvement for merging- Returns:
- a string description of the merge operation
-