org.graphstream.algorithm.measure
Class CommunityRelativeMeasure

java.lang.Object
  extended by org.graphstream.stream.SinkAdapter
      extended by org.graphstream.algorithm.measure.CommunityMeasure
          extended by org.graphstream.algorithm.measure.CommunityRelativeMeasure
All Implemented Interfaces:
Algorithm, DynamicAlgorithm, org.graphstream.stream.AttributeSink, org.graphstream.stream.ElementSink, org.graphstream.stream.Sink
Direct Known Subclasses:
NormalizedMutualInformation

public abstract class CommunityRelativeMeasure
extends CommunityMeasure

Computes and updates a relative measure based on the comparison between the current community assignment and a reference assignment on a given graph.

Author:
Guillaume-Jean Herbiet

Constructor Summary
CommunityRelativeMeasure(String marker)
           
CommunityRelativeMeasure(String marker, String referenceMarker)
          New comparative measure using "marker" as attribute name for each node current community assignment and "referenceMarker" as attribute name for each node reference assignment.
 
Method Summary
abstract  void compute()
          Run the algorithm.
 void nodeAdded(String graphId, long timeId, String nodeId)
           
 void nodeAttributeChanged(String graphId, long timeId, String nodeId, String attribute, Object oldValue, Object newValue)
           
 void nodeRemoved(String graphId, long timeId, String nodeId)
           
 
Methods inherited from class org.graphstream.algorithm.measure.CommunityMeasure
edgeAdded, edgeRemoved, getLastComputedValue, getMeasure, graphCleared, init, nodeAttributeAdded, terminate
 
Methods inherited from class org.graphstream.stream.SinkAdapter
edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, nodeAttributeRemoved, stepBegins
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommunityRelativeMeasure

public CommunityRelativeMeasure(String marker)

CommunityRelativeMeasure

public CommunityRelativeMeasure(String marker,
                                String referenceMarker)
New comparative measure using "marker" as attribute name for each node current community assignment and "referenceMarker" as attribute name for each node reference assignment.

Parameters:
marker - Current community assignment attribute name
referenceMarker - Reference community assignment attribute name
Method Detail

compute

public abstract void compute()
Description copied from interface: Algorithm
Run the algorithm. The Algorithm.init(Graph) method has to be called before computing.

Specified by:
compute in interface Algorithm
Specified by:
compute in class CommunityMeasure
See Also:
Algorithm.init(Graph)

nodeAdded

public void nodeAdded(String graphId,
                      long timeId,
                      String nodeId)
Specified by:
nodeAdded in interface org.graphstream.stream.ElementSink
Overrides:
nodeAdded in class CommunityMeasure

nodeRemoved

public void nodeRemoved(String graphId,
                        long timeId,
                        String nodeId)
Specified by:
nodeRemoved in interface org.graphstream.stream.ElementSink
Overrides:
nodeRemoved in class CommunityMeasure

nodeAttributeChanged

public void nodeAttributeChanged(String graphId,
                                 long timeId,
                                 String nodeId,
                                 String attribute,
                                 Object oldValue,
                                 Object newValue)
Specified by:
nodeAttributeChanged in interface org.graphstream.stream.AttributeSink
Overrides:
nodeAttributeChanged in class CommunityMeasure


Copyright © 2011. All Rights Reserved.