public abstract class DecentralizedCommunityAlgorithm extends Object implements DynamicAlgorithm, org.graphstream.stream.Sink
Constructor and Description |
---|
DecentralizedCommunityAlgorithm()
Create a new distributed community detection algorithm, without attaching
it to a graph
|
DecentralizedCommunityAlgorithm(org.graphstream.graph.Graph graph)
Create a new distributed community detection algorithm, attached to the
specified graph
|
DecentralizedCommunityAlgorithm(org.graphstream.graph.Graph graph,
String marker)
Create a new distributed community detection algorithm, attached to the
specified graph, and using the specified marker to store the community
attribute
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(org.graphstream.graph.Element element,
String attribute,
Object oldValue,
Object newValue) |
void |
compute()
Compute an iteration of the algorithm for all the nodes of the network.
|
abstract void |
computeNode(org.graphstream.graph.Node node)
Perform computation of one iteration of the algorithm on a given node.
|
void |
edgeAdded(String graphId,
long timeId,
String edgeId,
String fromNodeId,
String toNodeId,
boolean directed) |
void |
edgeAttributeAdded(String graphId,
long timeId,
String edgeId,
String attribute,
Object value) |
void |
edgeAttributeChanged(String graphId,
long timeId,
String edgeId,
String attribute,
Object oldValue,
Object newValue) |
void |
edgeAttributeRemoved(String graphId,
long timeId,
String edgeId,
String attribute) |
void |
edgeRemoved(String graphId,
long timeId,
String edgeId) |
String |
getMarker()
Get the marker used to store the community assignment
|
Random |
getRandom()
Get the random number generator currently used for this algorithm.
|
void |
graphAttributeAdded(String graphId,
long timeId,
String attribute,
Object value) |
void |
graphAttributeChanged(String graphId,
long timeId,
String attribute,
Object oldValue,
Object newValue) |
void |
graphAttributeRemoved(String graphId,
long timeId,
String attribute) |
void |
graphCleared(String graphId,
long timeId) |
void |
init(org.graphstream.graph.Graph graph)
Initialize the distributed community detection algorithm, attaching it to
the specified graph, and using the default marker to store the community
attribute.
|
void |
init(org.graphstream.graph.Graph graph,
String marker)
Initialize the distributed community detection algorithm, attaching it to
the specified graph, and using the specified marker to store the
community attribute
|
void |
nodeAdded(String graphId,
long timeId,
String nodeId) |
void |
nodeAttributeAdded(String graphId,
long timeId,
String nodeId,
String attribute,
Object value) |
void |
nodeAttributeChanged(String graphId,
long timeId,
String nodeId,
String attribute,
Object oldValue,
Object newValue) |
void |
nodeAttributeRemoved(String graphId,
long timeId,
String nodeId,
String attribute) |
void |
nodeRemoved(String graphId,
long timeId,
String nodeId) |
void |
setMarker(String marker)
Set the marker used to store the community assignment to the specified
value.
|
void |
setRandom(Random rng)
Set the random number generator for this algorithm.
|
void |
staticMode()
Enable the static mode.
|
void |
stepBegins(String graphId,
long timeId,
double time) |
void |
terminate()
Terminate the dynamic algorithm.
|
public DecentralizedCommunityAlgorithm()
public DecentralizedCommunityAlgorithm(org.graphstream.graph.Graph graph)
graph
- The graph on which the community assignment will be performedpublic DecentralizedCommunityAlgorithm(org.graphstream.graph.Graph graph, String marker)
graph
- The graph on which the community assignment will be performedmarker
- Marker string used to store the current community of a nodepublic void init(org.graphstream.graph.Graph graph, String marker)
graph
- marker
- public void init(org.graphstream.graph.Graph graph)
setRandom(Random)
function to use a
controlled random number generator with this algorithm.public void terminate()
DynamicAlgorithm
terminate
in interface DynamicAlgorithm
Algorithm.init(org.graphstream.graph.Graph)
public void staticMode()
public void setMarker(String marker)
marker
- public String getMarker()
public void setRandom(Random rng)
rng
- an initialized java.util.Random object.public Random getRandom()
public void compute()
compute
in interface Algorithm
Algorithm.init(Graph)
public abstract void computeNode(org.graphstream.graph.Node node)
node
- public void attributeChanged(org.graphstream.graph.Element element, String attribute, Object oldValue, Object newValue)
public void nodeAdded(String graphId, long timeId, String nodeId)
nodeAdded
in interface org.graphstream.stream.ElementSink
public void nodeRemoved(String graphId, long timeId, String nodeId)
nodeRemoved
in interface org.graphstream.stream.ElementSink
public void edgeAdded(String graphId, long timeId, String edgeId, String fromNodeId, String toNodeId, boolean directed)
edgeAdded
in interface org.graphstream.stream.ElementSink
public void edgeRemoved(String graphId, long timeId, String edgeId)
edgeRemoved
in interface org.graphstream.stream.ElementSink
public void graphCleared(String graphId, long timeId)
graphCleared
in interface org.graphstream.stream.ElementSink
public void stepBegins(String graphId, long timeId, double time)
stepBegins
in interface org.graphstream.stream.ElementSink
public void graphAttributeAdded(String graphId, long timeId, String attribute, Object value)
graphAttributeAdded
in interface org.graphstream.stream.AttributeSink
public void graphAttributeChanged(String graphId, long timeId, String attribute, Object oldValue, Object newValue)
graphAttributeChanged
in interface org.graphstream.stream.AttributeSink
public void graphAttributeRemoved(String graphId, long timeId, String attribute)
graphAttributeRemoved
in interface org.graphstream.stream.AttributeSink
public void nodeAttributeAdded(String graphId, long timeId, String nodeId, String attribute, Object value)
nodeAttributeAdded
in interface org.graphstream.stream.AttributeSink
public void nodeAttributeChanged(String graphId, long timeId, String nodeId, String attribute, Object oldValue, Object newValue)
nodeAttributeChanged
in interface org.graphstream.stream.AttributeSink
public void nodeAttributeRemoved(String graphId, long timeId, String nodeId, String attribute)
nodeAttributeRemoved
in interface org.graphstream.stream.AttributeSink
public void edgeAttributeAdded(String graphId, long timeId, String edgeId, String attribute, Object value)
edgeAttributeAdded
in interface org.graphstream.stream.AttributeSink
public void edgeAttributeChanged(String graphId, long timeId, String edgeId, String attribute, Object oldValue, Object newValue)
edgeAttributeChanged
in interface org.graphstream.stream.AttributeSink
Copyright © 2015. All rights reserved.