public class WeightedGraphMetrics extends AbstractReportVariables
Modifier and Type | Field and Description |
---|---|
protected double |
averagePathLength |
protected Map<Agent,Double> |
clusteringCoefficients |
protected org.apache.commons.math3.stat.descriptive.SummaryStatistics |
clusteringStats |
protected org.apache.commons.math3.stat.descriptive.SummaryStatistics |
degreeStats |
protected double |
diameter |
protected HashMap<Agent,Integer> |
inDegreeByAgent |
protected HashMap<Agent,Integer> |
outDegreeByAgent |
protected RelationshipTracker |
relationshipTracker |
protected long |
timeStamp |
protected long[] |
triadCounts |
name, simulation, xVariableName, yVariableNames
deleteQueue, genericListeners, specificListeners
Constructor and Description |
---|
WeightedGraphMetrics() |
WeightedGraphMetrics(RelationshipTracker relationshipTracker) |
Modifier and Type | Method and Description |
---|---|
static <V,E> Map<V,Double> |
clusteringCoefficients(edu.uci.ics.jung.graph.Graph<V,E> graph)
Returns a
Map of vertices to their clustering coefficients. |
void |
compute(SimEvent event)
Update variables.
|
void |
computeAveragePathLength() |
void |
computeClusteringStats() |
void |
computeDegreeStats() |
void |
computeDiameter() |
void |
computeTriads() |
double |
computeWeightedClusteringCoefficient(Agent vertex) |
double |
degree(Agent vertex) |
double |
edgeStrength(Agent i,
Agent j) |
Map<Agent,Double> |
getClusteringCoefficients() |
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
getClusteringStats() |
edu.uci.ics.jung.graph.Graph<Agent,WeightedEdge> |
getGraph() |
RelationshipTracker |
getRelationshipTracker() |
Map<Object,Number> |
getVariableBindings()
Get the values calculated by this report.
|
double |
outDegree(Agent vertex) |
void |
reset(SimulationEvent event) |
void |
setRelationshipTracker(RelationshipTracker relationshipTracker) |
static <V,E> int |
triangles(edu.uci.ics.jung.graph.Graph<V,E> graph,
V v) |
double |
vertexStrength(Agent vertex) |
createVariable, dispose, eventOccurred, getName, getNumberOfSeries, getTimeStamp, getX, getxVariableName, getY, getyVariableNames, initialise, recordMoments, recordSummaryStatistics, setName, tag
addListener, addListener, clearListeners, clone, fireEvent, notifyGenericListeners, notifySpecificListeners, processDeleteQueue, removeListener
protected RelationshipTracker relationshipTracker
protected org.apache.commons.math3.stat.descriptive.SummaryStatistics clusteringStats
protected long timeStamp
protected org.apache.commons.math3.stat.descriptive.SummaryStatistics degreeStats
protected long[] triadCounts
protected double diameter
protected double averagePathLength
public WeightedGraphMetrics(RelationshipTracker relationshipTracker)
public WeightedGraphMetrics()
public Map<Object,Number> getVariableBindings()
Report
getVariableBindings
in interface Report
getVariableBindings
in class AbstractReportVariables
Map
of user-readable variable names to their
associated values.public void compute(SimEvent event)
ReportVariables
compute
in interface ReportVariables
compute
in class AbstractReportVariables
public edu.uci.ics.jung.graph.Graph<Agent,WeightedEdge> getGraph()
public void computeDegreeStats()
public void computeDiameter()
public void computeAveragePathLength()
public void computeClusteringStats()
public void computeTriads()
public double outDegree(Agent vertex)
public double degree(Agent vertex)
public double vertexStrength(Agent vertex)
public double computeWeightedClusteringCoefficient(Agent vertex)
public RelationshipTracker getRelationshipTracker()
public void setRelationshipTracker(RelationshipTracker relationshipTracker)
public void reset(SimulationEvent event)
public org.apache.commons.math3.stat.descriptive.SummaryStatistics getClusteringStats()
public static <V,E> Map<V,Double> clusteringCoefficients(edu.uci.ics.jung.graph.Graph<V,E> graph)
Map
of vertices to their clustering coefficients.
The clustering coefficient cc(v) of a vertex v is defined as follows:
degree(v) == {0,1}
: 0
degree(v) == n, n >= 2
: given S, the set of neighbors
of v
: cc(v) = (the sum over all w in S of the number of
other elements of w that are neighbors of w) / ((|S| * (|S| - 1) / 2).
Less formally, the fraction of v
's neighbors that are also
neighbors of each other.
Note: This algorithm treats its argument as an undirected graph; edge direction is ignored.
graph
- the graph whose clustering coefficients are to be calculatedpublic static <V,E> int triangles(edu.uci.ics.jung.graph.Graph<V,E> graph, V v)
Copyright © 2014. All rights reserved.