public abstract class AbstractCentrality extends Object implements Algorithm
computeCentrality()
method where centrality values will be stored in
data
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractCentrality.NormalizationMode |
Modifier and Type | Field and Description |
---|---|
protected String |
centralityAttribute
Attribute name where centrality value will be stored.
|
protected double[] |
data
Array containing centrality values computed by centrality algorithms.
|
protected Graph |
graph
Graph on which centrality is computed.
|
protected AbstractCentrality.NormalizationMode |
normalize
Flag indicating if centrality values should be normalized between 0 and
1.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractCentrality(String attribute,
AbstractCentrality.NormalizationMode normalize)
Default contructor.
|
Modifier and Type | Method and Description |
---|---|
void |
compute()
Run the algorithm.
|
protected abstract void |
computeCentrality()
Define the computation of centrality values.
|
void |
copyValuesTo(String attribute)
Copy values previously computed to a specific attribute.
|
void |
copyValuesTo(String attribute,
AbstractCentrality.NormalizationMode normalize)
Copy values previously computed to a specific attribute.
|
String |
getCentralityAttribute()
Getter for
centralityAttribute . |
AbstractCentrality.NormalizationMode |
getNormalizationMode()
Getter for
normalize . |
void |
init(Graph graph)
Initialization of the algorithm.
|
void |
setCentralityAttribute(String centralityAttribute)
Setter for
centralityAttribute . |
void |
setNormalizationMode(AbstractCentrality.NormalizationMode normalize)
Setter for
normalize . |
protected String centralityAttribute
protected AbstractCentrality.NormalizationMode normalize
protected double[] data
protected AbstractCentrality(String attribute, AbstractCentrality.NormalizationMode normalize)
attribute
- attribute where centrality will be storednormalize
- define the normalization modepublic void init(Graph graph)
Algorithm
Algorithm.compute()
method to initialize or reset the algorithm according
to the new given graph.public void compute()
Algorithm
Algorithm.init(Graph)
method has to be called
before computing.compute
in interface Algorithm
Algorithm.init(Graph)
public void copyValuesTo(String attribute)
compute()
method needs to have been call before calling this
one.attribute
- destination attribute where values of centrality will be
storedpublic void copyValuesTo(String attribute, AbstractCentrality.NormalizationMode normalize)
compute()
method needs to have been call before calling this
one.attribute
- destination attribute where values of centrality will be
storednormalize
- defines the way that values have to be normalizedpublic String getCentralityAttribute()
centralityAttribute
.centralityAttribute
public void setCentralityAttribute(String centralityAttribute)
centralityAttribute
.centralityAttribute
- new value of centralityAttribute
public AbstractCentrality.NormalizationMode getNormalizationMode()
normalize
.normalize
public void setNormalizationMode(AbstractCentrality.NormalizationMode normalize)
normalize
.normalize
- new value of normalize
protected abstract void computeCentrality()
data
using node index.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses