net.sourceforge.jabm.report
Class WeightedGraphMetrics
java.lang.Object
net.sourceforge.jabm.event.AbstractModel
net.sourceforge.jabm.report.AbstractReportVariables
net.sourceforge.jabm.report.WeightedGraphMetrics
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, EventListener, Model, Report, ReportVariables, XYReportVariables
public class WeightedGraphMetrics
- extends AbstractReportVariables
- See Also:
- Serialized Form
-
-
Methods inherited from class net.sourceforge.jabm.report.AbstractReportVariables |
createVariable, dispose, eventOccurred, getName, getNumberOfSeries, getTimeStamp, getX, getxVariableName, getY, getyVariableNames, initialise, recordMoments, recordSummaryStatistics, setName, tag |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
relationshipTracker
protected RelationshipTracker relationshipTracker
clusteringCoefficients
protected java.util.Map<Agent,java.lang.Double> clusteringCoefficients
clusteringStats
protected org.apache.commons.math3.stat.descriptive.SummaryStatistics clusteringStats
timeStamp
protected long timeStamp
degreeStats
protected org.apache.commons.math3.stat.descriptive.SummaryStatistics degreeStats
inDegreeByAgent
protected java.util.HashMap<Agent,java.lang.Integer> inDegreeByAgent
outDegreeByAgent
protected java.util.HashMap<Agent,java.lang.Integer> outDegreeByAgent
diameter
protected double diameter
averagePathLength
protected double averagePathLength
WeightedGraphMetrics
public WeightedGraphMetrics(RelationshipTracker relationshipTracker)
WeightedGraphMetrics
public WeightedGraphMetrics()
getVariableBindings
public java.util.Map<java.lang.Object,java.lang.Number> getVariableBindings()
- Description copied from interface:
Report
- Get the values calculated by this report.
- Specified by:
getVariableBindings
in interface Report
- Overrides:
getVariableBindings
in class AbstractReportVariables
- Returns:
- A
Map
of user-readable variable names to their
associated values.
compute
public void compute(SimEvent event)
- Description copied from interface:
ReportVariables
- Update variables.
- Specified by:
compute
in interface ReportVariables
- Overrides:
compute
in class AbstractReportVariables
getGraph
public edu.uci.ics.jung.graph.Graph<Agent,WeightedEdge> getGraph()
computeDegreeStats
public void computeDegreeStats()
computeDiameter
public void computeDiameter()
computeAveragePathLength
public void computeAveragePathLength()
computeClusteringStats
public void computeClusteringStats()
outDegree
public double outDegree(Agent vertex)
degree
public double degree(Agent vertex)
vertexStrength
public double vertexStrength(Agent vertex)
edgeStrength
public double edgeStrength(Agent i,
Agent j)
computeWeightedClusteringCoefficient
public double computeWeightedClusteringCoefficient(Agent vertex)
getRelationshipTracker
public RelationshipTracker getRelationshipTracker()
setRelationshipTracker
public void setRelationshipTracker(RelationshipTracker relationshipTracker)
reset
public void reset(SimulationEvent event)
getClusteringCoefficients
public java.util.Map<Agent,java.lang.Double> getClusteringCoefficients()
getClusteringStats
public org.apache.commons.math3.stat.descriptive.SummaryStatistics getClusteringStats()
clusteringCoefficients
public static <V,E> java.util.Map<V,java.lang.Double> clusteringCoefficients(edu.uci.ics.jung.graph.Graph<V,E> graph)
- Returns a
Map
of vertices to their clustering coefficients.
The clustering coefficient cc(v) of a vertex v is defined as follows:
triangles
public static <V,E> int triangles(edu.uci.ics.jung.graph.Graph<V,E> graph,
V v)