The first time a statistic is calculated, the values of the parameters used (epsilon, directed/undirected...) are correctly interpreted and the report shown. But if I try to run a statistic calculation again with other values for the parameters, the report shown is always the first one that was created.

By looking at the source code of the module, it seems that the statistic is run correctly each time but the Statistics object used to generate the report (inside the method showReport of the class StatisticsFrontEnd) is always the one that was created the first time the statistic was run. The method doesn't use the last Statistics object created.

Is it a bug ? If so, do you mind if I have a look into it ?

## each statistic calculation can only be done once

### Re: each statistic calculation can only be done once

Hi, thanks for finding this issue. It's indeed a bug. Could you please report it on our bug tracker?

For sure you can have a look and propose a patch, that would be nice. As you suggested it the StatisticsModel is not correctly maintaining the list of Statistics instances.

For sure you can have a look and propose a patch, that would be nice. As you suggested it the StatisticsModel is not correctly maintaining the list of Statistics instances.

### Re: each statistic calculation can only be done once

I just reported the bug and will try to find a fix.

### Re: each statistic calculation can only be done once

I found a way to fix the bug by making sure that only one instance of Statistic can be created for each StatisticUI. It is reused if the statistic is run more than once. It compiles and each statistic can now be run more than once.

I created a branch on Launchpad and updated the fix on it. Is it the correct thing to do ? Also I was not sure whether I had to include the description of the changes in the 2 files modified. I just made corrections and added small comments.

I created a branch on Launchpad and updated the fix on it. Is it the correct thing to do ? Also I was not sure whether I had to include the description of the changes in the 2 files modified. I just made corrections and added small comments.

### Re: each statistic calculation can only be done once

Excellent job, I'lm looking at the patch right now. I'll merge it tomorrow, seems fixing the problem.

Creating a branch is indeed the best way to do this. For me it's really easy I just do a merge with your branch to integrate the fixes.

Just a tip: Format your code using Netbeans (Right-Click > Format on source code). We all do this, it avoids commit format change later on.

Creating a branch is indeed the best way to do this. For me it's really easy I just do a merge with your branch to integrate the fixes.

Just a tip: Format your code using Netbeans (Right-Click > Format on source code). We all do this, it avoids commit format change later on.

### Re: each statistic calculation can only be done once

I merged your patch, thanks for your contribution