public abstract class CommunityRelativeMeasure extends CommunityMeasure
Modifier and Type | Field and Description |
---|---|
protected HashMap<Object,HashSet<Node>> |
referenceCommunities
All reference communities indexed by their marker value.
|
protected String |
referenceMarker
Name of the attribute marking the reference communities.
|
communities, graph, graphChanged, M, marker
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
compute()
Run the algorithm.
|
protected void |
initialize() |
void |
nodeAdded(String graphId,
long timeId,
String nodeId)
A node was inserted in the given graph.
|
void |
nodeAttributeChanged(String graphId,
long timeId,
String nodeId,
String attribute,
Object oldValue,
Object newValue)
A node attribute was changed.
|
void |
nodeRemoved(String graphId,
long timeId,
String nodeId)
A node was removed from the graph.
|
assignNode, edgeAdded, edgeRemoved, getLastComputedValue, getMeasure, graphCleared, init, nodeAttributeAdded, terminate, unassignNode
edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, nodeAttributeRemoved, stepBegins
protected String referenceMarker
protected HashMap<Object,HashSet<Node>> referenceCommunities
public CommunityRelativeMeasure(String marker)
public CommunityRelativeMeasure(String marker, String referenceMarker)
marker
- Current community assignment attribute namereferenceMarker
- Reference community assignment attribute namepublic abstract void compute()
Algorithm
Algorithm.init(Graph)
method has to be called
before computing.compute
in interface Algorithm
compute
in class CommunityMeasure
Algorithm.init(Graph)
protected void initialize()
initialize
in class CommunityMeasure
public void nodeAdded(String graphId, long timeId, String nodeId)
ElementSink
nodeAdded
in interface ElementSink
nodeAdded
in class CommunityMeasure
graphId
- Identifier of the graph where the node was added.nodeId
- Identifier of the added node.public void nodeRemoved(String graphId, long timeId, String nodeId)
ElementSink
nodeRemoved
in interface ElementSink
nodeRemoved
in class CommunityMeasure
graphId
- Identifier of the graph where the node will be removed.nodeId
- Identifier of the removed node.public void nodeAttributeChanged(String graphId, long timeId, String nodeId, String attribute, Object oldValue, Object newValue)
AttributeSink
nodeAttributeChanged
in interface AttributeSink
nodeAttributeChanged
in class CommunityMeasure
graphId
- Identifier of the graph where the change occurred.nodeId
- Identifier of the node whose attribute changed.attribute
- The attribute name.oldValue
- The attribute old value.newValue
- The attribute new value.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses