Class AbstractCentrality
java.lang.Object
org.graphstream.algorithm.measure.AbstractCentrality
- All Implemented Interfaces:
Algorithm
- Direct Known Subclasses:
ClosenessCentrality,DegreeCentrality,EigenvectorCentrality
public abstract class AbstractCentrality extends Object implements Algorithm
Base class for centrality measures. Subclasses should implements a
computeCentrality() method where centrality values will be stored in
data.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractCentrality.NormalizationMode -
Method Summary
Modifier and Type Method Description voidcompute()Run the algorithm.voidcopyValuesTo(String attribute)Copy values previously computed to a specific attribute.voidcopyValuesTo(String attribute, AbstractCentrality.NormalizationMode normalize)Copy values previously computed to a specific attribute.StringdefaultMessage()StringgetCentralityAttribute()Getter forcentralityAttribute.AbstractCentrality.NormalizationModegetNormalizationMode()Getter fornormalize.voidinit(org.graphstream.graph.Graph graph)Initialization of the algorithm.voidsetCentralityAttribute(String centralityAttribute)Setter forcentralityAttribute.voidsetNormalizationMode(AbstractCentrality.NormalizationMode normalize)Setter fornormalize.
-
Method Details
-
init
public void init(org.graphstream.graph.Graph graph)Description copied from interface:AlgorithmInitialization of the algorithm. This method has to be called before theAlgorithm.compute()method to initialize or reset the algorithm according to the new given graph. -
compute
public void compute()Description copied from interface:AlgorithmRun the algorithm. TheAlgorithm.init(Graph)method has to be called before computing.- Specified by:
computein interfaceAlgorithm- See Also:
Algorithm.init(Graph)
-
copyValuesTo
Copy values previously computed to a specific attribute. Thecompute()method needs to have been call before calling this one.- Parameters:
attribute- destination attribute where values of centrality will be stored
-
copyValuesTo
Copy values previously computed to a specific attribute. Thecompute()method needs to have been call before calling this one.- Parameters:
attribute- destination attribute where values of centrality will be storednormalize- defines the way that values have to be normalized
-
getCentralityAttribute
Getter forcentralityAttribute.- Returns:
centralityAttribute
-
setCentralityAttribute
Setter forcentralityAttribute.- Parameters:
centralityAttribute- new value ofcentralityAttribute
-
getNormalizationMode
Getter fornormalize.- Returns:
normalize
-
setNormalizationMode
Setter fornormalize.- Parameters:
normalize- new value ofnormalize
-
defaultMessage
-