public class GraphMetrics
extends Object
Modifier and Type | Field and Description |
---|---|
(package private) int |
actors |
(package private) int |
all_node_degrees |
(package private) int |
concept_degrees |
(package private) int |
concepts |
(package private) TreeSet<String> |
conceptTypeLabels |
(package private) int |
contexts |
(package private) int |
corefs |
(package private) Graph |
currentGraph |
(package private) NumberFormat |
nformat |
(package private) int |
relations |
(package private) TreeSet<String> |
relationTypeLabels |
(package private) int |
reltypes |
private boolean |
suppressZeroes |
(package private) int |
types |
Constructor and Description |
---|
GraphMetrics(Graph g)
Instantiate a set of metrics for the given graph.
|
Modifier and Type | Method and Description |
---|---|
int |
diameter(Graph g)
Returns the "diameter" of the graph, which is defined as the longest shortest path between any two nodes of the graph.
|
String |
getGraphMetrics(boolean compress)
Create a text string containing tab-separated metrics and observations about the graph.
|
void |
makeAllMetrics()
Perform all the counts necessary for displaying the metrics.
|
String |
showAllMetrics()
Display the results of collecting all the measurements.
|
protected String |
showOneMetric(String name,
float value) |
protected String |
showString(String name,
String value) |
Graph currentGraph
int concepts
int relations
int actors
int contexts
int types
int reltypes
int corefs
int concept_degrees
int all_node_degrees
TreeSet<String> conceptTypeLabels
TreeSet<String> relationTypeLabels
NumberFormat nformat
private boolean suppressZeroes
public GraphMetrics(Graph g)
g
- the top-level graph being measured. May include type/relation hierarchies, etc.public String getGraphMetrics(boolean compress)
public void makeAllMetrics()
protected String showString(String name, String value)
protected String showOneMetric(String name, float value)
name
- The human-readable name of the metricvalue
- The metric value to be printedsuppressZeroes
public String showAllMetrics()
total_concept_instances | Number of concept instances (boxes) in the graph |
total_relation_instances | Number of relation instances (ovals) in the graph |
total_actor_instances | Number of actor instances (diamonds) in the graph |
total_type_hierarchy_labels | Number of type label instances (underlined types) whether in hierarchies or not |
total_relation_hierarchy_labels | Number of relation label instances (underlined relations) whether in hierarchies or not |
total_lines_of_identity | Number of lines of identity (dashed lines) in the graph |
total_contexts | Number of contexts (rectangular borders) in the graph |
average_node_degree | Average number of arrows/lines-of-identity connected to each concept/relation/actor/context/etc. |
average_concept_context_degree | Average number of arrows/lines-of-identity connected to concept or context only |
number_of_unique_concept_types | Number of unique concept types (regardless of referent) |
unique_concept_type_names | List of unique concept type names (ignoring referent) |
number_of_unique_relation_types | Number of unique relation types |
unique_relation_type_names | List of unique concept types (regardless of referent) |
concept_type_variability | total_concept_instances / number_of_unique_concept_types |
relation_type_variability | total_relation_instances / number_of_unique_relation_types |
public int diameter(Graph g)