Commit 14880188 authored by balanche's avatar balanche

Correction d'un bug sur la progress bar Sampling et d'un autre bug sur la progress bar Displaying

parent 180e6605
......@@ -35,6 +35,8 @@ import jcl.utils.exceptions.MethodNotImplementedException;
* </p>
*
* @author WEMMERT Cedric
*
* Implementation progressable par jean-Noël Balanche
*/
public abstract class Classification extends Observable implements
......
......@@ -1170,7 +1170,6 @@ public class ClusteringEvaluation {
int CPindex = 2;
ClusteringResult clusteringResult = classification.getClusteringResult();
Iterator<DataObject> iter = clusteringResult.getData().getWholeSourceDataObjects();
// initialization for WG
......@@ -1184,11 +1183,13 @@ public class ClusteringEvaluation {
for (int k = 0; k < clusteringResult.getNbClusters(); k++) {
clustersSE[k] = 0;
}
double step = 100./clusteringResult.getNbObjects();
double progress = classification.getProgress()+step;
for(int n = 0 ; iter.hasNext() ; n++) {
DataObject object = iter.next();
int currentCluster = clusteringResult.getClusterMap(false)[n];
int currentCluster = clusteringResult.getClusterMap(false)[n];
// compute for WG
double distMinWG = Double.MAX_VALUE;
......@@ -1212,7 +1213,12 @@ public class ClusteringEvaluation {
// compute for Square Error
final double distanceSE = clusteringResult.getCluster(currentCluster).distance(currentCluster);
qualities[SEindex] += (distanceSE * distanceSE);
/*
* increments classification's progressable (for the "Displaying" step)
*/
progress+=step;
classification.setProgress((int)progress);
}
// merge result for WG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment