Gephi plugin doesn't stop

Please use a mailing-list, see http://gephi.org/developers/
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
CodeIt
Posts:9
Joined:02 Oct 2017 07:06
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Gephi plugin doesn't stop

Post by CodeIt » 15 Nov 2017 17:04

Hello,
I am writing on a plugin for Gephi in which the label of the nodes change depending on the labels of the neighbor nodes.
This should serve the clustering.
The changed labels will show in a column of the data labor. So far the code works.
As soon as the labels should not change, stop the programm should be stopped.
And here is the problem the program doesn't stop.
I use the ColumnObserver and the observer.hasColumnChanged() method. See the following code part:

public void execute(GraphModel graphModel){
Table nodeTable = graphModel.getNodeTable();

Column col = nodeTable.getColumn(prob);
if (col == null) {
col = nodeTable.addColumn(prob, String.class);
}
ColumnObserver observer = col.createColumnObserver(true);

Graph graph = graph.Model.getGraph();
Node[] nodes = graph.getNodes().toArray();
...
boolean changed = true;
while(changed){
for (Node n: nodes){
....
n.setLabel(newLabel); //here should be a method() to check the graph if a change of the labels occured
}

if (observer.hasColumnChanged()){
change = true;
}else{
change = false;
}

What could be the reason why the program does not stop.

For any help thanks in advance

User avatar
eduramiba
Gephi Code Manager
Posts:1064
Joined:22 Mar 2010 15:30
Location:Madrid, Spain
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Gephi plugin doesn't stop

Post by eduramiba » 15 Nov 2017 17:16


Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable