Ranking modularity Java.lang.NullPointerException

Once it's running
ivancorme
Posts:8
Joined:28 Aug 2016 12:21
[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: Ranking modularity Java.lang.NullPointerException

Post by ivancorme » 29 Aug 2016 21:27

How do I do that in this piece of code??

modularity.execute(graphModel);

//Partition with 'modularity_class', just created by Modularity algorithm
Column modColumn = graphModel.getNodeTable().getColumn(Modularity.MODULARITY_CLASS);

Function func2 = appearanceModel.getNodeFunction(graph, modColumn, PartitionElementColorTransformer.class);

Partition partition2 = ((PartitionFunction) func2).getPartition();

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: Ranking modularity Java.lang.NullPointerException

Post by eduramiba » 30 Aug 2016 09:34

Maybe with the force functions for https://gephi.org/gephi-toolkit/0.9.1/a ... oller.html but I am not sure how to use them.

ivancorme
Posts:8
Joined:28 Aug 2016 12:21
[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: Ranking modularity Java.lang.NullPointerException

Post by ivancorme » 30 Aug 2016 14:48

I tried to force the function to be partition and it changes from ranking to partition but when I try to get the partitions later I get a pointer to Null.

So it seems that is not possible to do the casting like that. Any other idea??

Why does it work with the GUI and not with the toolkit??

Ivan

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: Ranking modularity Java.lang.NullPointerException

Post by eduramiba » 31 Aug 2016 09:34

You can check the UI code here https://github.com/gephi/gephi/blob/mas ... .java#L401 so maybe you can obtain the same behaviour.

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