net.sourceforge.jabm.report
Class WeightedGraphMetrics

java.lang.Object
  extended by net.sourceforge.jabm.event.AbstractModel
      extended by net.sourceforge.jabm.report.AbstractReportVariables
          extended by 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
 

Field Summary
protected  double averagePathLength
           
protected  java.util.Map<Agent,java.lang.Double> clusteringCoefficients
           
protected  org.apache.commons.math3.stat.descriptive.SummaryStatistics clusteringStats
           
protected  org.apache.commons.math3.stat.descriptive.SummaryStatistics degreeStats
           
protected  double diameter
           
protected  java.util.HashMap<Agent,java.lang.Integer> inDegreeByAgent
           
protected  java.util.HashMap<Agent,java.lang.Integer> outDegreeByAgent
           
protected  RelationshipTracker relationshipTracker
           
protected  long timeStamp
           
 
Fields inherited from class net.sourceforge.jabm.report.AbstractReportVariables
name, simulation, xVariableName, yVariableNames
 
Fields inherited from class net.sourceforge.jabm.event.AbstractModel
deleteQueue, genericListeners, specificListeners
 
Constructor Summary
WeightedGraphMetrics()
           
WeightedGraphMetrics(RelationshipTracker relationshipTracker)
           
 
Method Summary
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.
 void compute(SimEvent event)
          Update variables.
 void computeAveragePathLength()
           
 void computeClusteringStats()
           
 void computeDegreeStats()
           
 void computeDiameter()
           
 double computeWeightedClusteringCoefficient(Agent vertex)
           
 double degree(Agent vertex)
           
 double edgeStrength(Agent i, Agent j)
           
 java.util.Map<Agent,java.lang.Double> getClusteringCoefficients()
           
 org.apache.commons.math3.stat.descriptive.SummaryStatistics getClusteringStats()
           
 edu.uci.ics.jung.graph.Graph<Agent,WeightedEdge> getGraph()
           
 RelationshipTracker getRelationshipTracker()
           
 java.util.Map<java.lang.Object,java.lang.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)
           
 
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 net.sourceforge.jabm.event.AbstractModel
addListener, addListener, clearListeners, clone, fireEvent, notifyGenericListeners, notifySpecificListeners, processDeleteQueue, removeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

WeightedGraphMetrics

public WeightedGraphMetrics(RelationshipTracker relationshipTracker)

WeightedGraphMetrics

public WeightedGraphMetrics()
Method Detail

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)