de.ipk_gatersleben.ag_nw.centilib.centralities
Class VertexCentrality<V,E>
java.lang.Object
de.ipk_gatersleben.ag_nw.centilib.centralities.VertexCentrality<V,E>
- Type Parameters:
V
- Type of nodesE
- Type of edges
- All Implemented Interfaces:
- VertexScorer<V,Double>
public abstract class VertexCentrality<V,E>
- extends Object
- implements VertexScorer<V,Double>
This abstract class implements the interface VertexScorer and adds some methods
for accessing the name, graph and average centrality value.
- Author:
- Johannes Graessler
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected String name
output
protected Map<V,Double> output
graph
protected Graph<V,E> graph
average
protected Double average
VertexCentrality
public VertexCentrality(String name,
Graph<V,E> graph)
- Create an instance for the given graph.
- Parameters:
name
- The name of the centrality.graph
- The graph this centrality is computed for.
getName
public String getName()
- Returns the name of this centrality.
- Returns:
- the name of the centrality.
getGraph
public Graph<V,E> getGraph()
- Returns the graph, this centrality is computed for.
- Returns:
- the graph this centrality is computed for.
getAverageValue
public Double getAverageValue()
- Returns the average value of this centrality if possible. If the values were not computed yet or there are some values
missing Double.NaN is returned.
- Returns:
- the average value or Double.NaN