public abstract class DecentralizedCommunityAlgorithm extends java.lang.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,
java.lang.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,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.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.
|
java.lang.String |
defaultMessage() |
void |
edgeAdded(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String fromNodeId,
java.lang.String toNodeId,
boolean directed) |
void |
edgeAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute,
java.lang.Object value) |
void |
edgeAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue) |
void |
edgeAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute) |
void |
edgeRemoved(java.lang.String graphId,
long timeId,
java.lang.String edgeId) |
java.lang.String |
getMarker()
Get the marker used to store the community assignment
|
java.util.Random |
getRandom()
Get the random number generator currently used for this algorithm.
|
void |
graphAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String attribute,
java.lang.Object value) |
void |
graphAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue) |
void |
graphAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String attribute) |
void |
graphCleared(java.lang.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,
java.lang.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(java.lang.String graphId,
long timeId,
java.lang.String nodeId) |
void |
nodeAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute,
java.lang.Object value) |
void |
nodeAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue) |
void |
nodeAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute) |
void |
nodeRemoved(java.lang.String graphId,
long timeId,
java.lang.String nodeId) |
void |
setMarker(java.lang.String marker)
Set the marker used to store the community assignment to the specified
value.
|
void |
setRandom(java.util.Random rng)
Set the random number generator for this algorithm.
|
void |
staticMode()
Enable the static mode.
|
void |
stepBegins(java.lang.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,
java.lang.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,
java.lang.String marker)
graph - the graphmarker - marker string to store the community attributepublic void init(org.graphstream.graph.Graph graph)
setRandom(Random) function to use a
controlled random number generator with this algorithm.public void terminate()
DynamicAlgorithmterminate in interface DynamicAlgorithmAlgorithm.init(org.graphstream.graph.Graph)public void staticMode()
public void setMarker(java.lang.String marker)
marker - marker string to store the community attributepublic java.lang.String getMarker()
public void setRandom(java.util.Random rng)
rng - an initialized java.util.Random object.public java.util.Random getRandom()
public void compute()
compute in interface AlgorithmAlgorithm.init(Graph)public abstract void computeNode(org.graphstream.graph.Node node)
node - node to computepublic void attributeChanged(org.graphstream.graph.Element element,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
public void nodeAdded(java.lang.String graphId,
long timeId,
java.lang.String nodeId)
nodeAdded in interface org.graphstream.stream.ElementSinkpublic void nodeRemoved(java.lang.String graphId,
long timeId,
java.lang.String nodeId)
nodeRemoved in interface org.graphstream.stream.ElementSinkpublic void edgeAdded(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String fromNodeId,
java.lang.String toNodeId,
boolean directed)
edgeAdded in interface org.graphstream.stream.ElementSinkpublic void edgeRemoved(java.lang.String graphId,
long timeId,
java.lang.String edgeId)
edgeRemoved in interface org.graphstream.stream.ElementSinkpublic void graphCleared(java.lang.String graphId,
long timeId)
graphCleared in interface org.graphstream.stream.ElementSinkpublic void stepBegins(java.lang.String graphId,
long timeId,
double time)
stepBegins in interface org.graphstream.stream.ElementSinkpublic void graphAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String attribute,
java.lang.Object value)
graphAttributeAdded in interface org.graphstream.stream.AttributeSinkpublic void graphAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
graphAttributeChanged in interface org.graphstream.stream.AttributeSinkpublic void graphAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String attribute)
graphAttributeRemoved in interface org.graphstream.stream.AttributeSinkpublic void nodeAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute,
java.lang.Object value)
nodeAttributeAdded in interface org.graphstream.stream.AttributeSinkpublic void nodeAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
nodeAttributeChanged in interface org.graphstream.stream.AttributeSinkpublic void nodeAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute)
nodeAttributeRemoved in interface org.graphstream.stream.AttributeSinkpublic void edgeAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute,
java.lang.Object value)
edgeAttributeAdded in interface org.graphstream.stream.AttributeSinkpublic void edgeAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
edgeAttributeChanged in interface org.graphstream.stream.AttributeSinkpublic void edgeAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute)
edgeAttributeRemoved in interface org.graphstream.stream.AttributeSinkpublic java.lang.String defaultMessage()