public class Modularity extends Object implements Statistics, LongTask
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
Modularity.Community |
(package private) class |
Modularity.CommunityStructure |
(package private) class |
Modularity.ModEdge |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isCanceled |
private boolean |
isRandomized |
private double |
modularity |
static String |
MODULARITY_CLASS |
private double |
modularityResolution |
private ProgressTicket |
progress |
private double |
resolution |
private Modularity.CommunityStructure |
structure |
private boolean |
useWeight |
| Constructor and Description |
|---|
Modularity() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Cancel the task.
|
protected HashMap<String,Double> |
computeModularity(org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
int[] comStructure,
double currentResolution,
boolean randomized,
boolean weighted) |
void |
execute(org.gephi.graph.api.Graph hgraph) |
void |
execute(org.gephi.graph.api.GraphModel graphModel)
Executes the statistics algorithm.
|
(package private) int[] |
fillComStructure(org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
int[] comStructure) |
(package private) double[] |
fillDegreeCount(org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
int[] comStructure,
double[] nodeDegrees,
boolean weighted) |
private double |
finalQ(int[] struct,
double[] degrees,
org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
double totalWeight,
double usedResolution,
boolean weighted) |
double |
getModularity() |
boolean |
getRandom() |
String |
getReport()
Returns an HTML string that displays the statistics result.
|
double |
getResolution() |
boolean |
getUseWeight() |
private double |
q(int node,
Modularity.Community community,
Modularity.CommunityStructure theStructure,
double currentResolution) |
private void |
saveValues(int[] struct,
org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure) |
void |
setProgressTicket(ProgressTicket progressTicket)
Set the progress ticket for the long task.
|
void |
setRandom(boolean isRandomized) |
void |
setResolution(double resolution) |
void |
setUseWeight(boolean useWeight) |
(package private) Modularity.Community |
updateBestCommunity(Modularity.CommunityStructure theStructure,
int i,
double currentResolution) |
public static final String MODULARITY_CLASS
private ProgressTicket progress
private boolean isCanceled
private Modularity.CommunityStructure structure
private double modularity
private double modularityResolution
private boolean isRandomized
private boolean useWeight
private double resolution
public void setRandom(boolean isRandomized)
public boolean getRandom()
public void setUseWeight(boolean useWeight)
public boolean getUseWeight()
public void setResolution(double resolution)
public double getResolution()
public boolean cancel()
LongTasktrue if the task has been sucessfully cancelled, false otherwise.public void setProgressTicket(ProgressTicket progressTicket)
LongTasksetProgressTicket in interface LongTaskprogressTicket - the progress ticket for this taskpublic void execute(org.gephi.graph.api.GraphModel graphModel)
StatisticsIt is preferable to work on visible graphs, to be synchronized with the visualization.
execute in interface StatisticsgraphModel - The graph modelpublic void execute(org.gephi.graph.api.Graph hgraph)
protected HashMap<String,Double> computeModularity(org.gephi.graph.api.Graph hgraph, Modularity.CommunityStructure theStructure, int[] comStructure, double currentResolution, boolean randomized, boolean weighted)
Modularity.Community updateBestCommunity(Modularity.CommunityStructure theStructure, int i, double currentResolution)
int[] fillComStructure(org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
int[] comStructure)
double[] fillDegreeCount(org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
int[] comStructure,
double[] nodeDegrees,
boolean weighted)
private double finalQ(int[] struct,
double[] degrees,
org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure,
double totalWeight,
double usedResolution,
boolean weighted)
private void saveValues(int[] struct,
org.gephi.graph.api.Graph hgraph,
Modularity.CommunityStructure theStructure)
public double getModularity()
public String getReport()
StatisticsgetReport in interface Statisticsprivate double q(int node,
Modularity.Community community,
Modularity.CommunityStructure theStructure,
double currentResolution)
Copyright © 2007–2016 Gephi Consortium. All rights reserved.