Commit a2c981db authored by lafabregue's avatar lafabregue

small fixes

parent 5adc0c52
......@@ -725,7 +725,7 @@ public abstract class Classification extends Observable implements
}
}
if(allEnded) {//return the usual value (this.progress) when all progressables are done (to monitor the final step which is displaying the result)
progress = this.progress;
progress = this.progressM;
//System.out.println("all progressable ended");
}
return progress;
......
......@@ -205,7 +205,8 @@ public abstract class LearningMethod implements Progressable, Cloneable,
*/
@Override
public int getProgress() {
return (int) (((double) this.progress / (double) this.progressM) * 100.0);
int res = (int) (((double) this.progress / (double) this.progressM) * 100.0);
return res;
}
/**
......
package jcl.learning.methods.monostrategy.kmeans;
import java.awt.Color;
import java.io.StringReader;
import java.rmi.server.RMIFailureHandler;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Vector;
import jcl.Classification;
......@@ -20,14 +15,11 @@ import jcl.data.attribute.Attribute;
import jcl.data.distance.Distance;
import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter;
import jcl.data.distance.EmptyDistanceParameter;
import jcl.data.distance.MetaDistance;
import jcl.data.distance.sequential.ParameterDTW;
import jcl.data.mask.DummyMask;
import jcl.data.mask.Mask;
import jcl.data.mask.MultiIDIntArrayMask;
import jcl.evaluation.clustering.ClusteringEvaluation;
import jcl.learning.LearningParameters;
import jcl.learning.LearningResult;
import jcl.utils.exceptions.JCLFormatException;
import jcl.utils.io.JCLModelExchange;
......@@ -273,6 +265,7 @@ public class LearningResultKmeans extends LearningResult {
int clusterMap[] = new int[nbObjects];
int nbThreads = ((ParametersKmeans) this.params).nbThreads;
// int nbThreads = 1;
if (((ParametersKmeans) this.params).fuzzy) {
// pour chaque objet...
int i =0;
......@@ -861,6 +854,7 @@ public class LearningResultKmeans extends LearningResult {
incProgress();
i++;
}
endProgress();
// System.out.println("Fin thread progressM="+progressM+" progress="+progress+" i="+i);
}
......
......@@ -57,8 +57,10 @@ public class GlobalWeights extends ClassificationWeights {
if (weights.subWeights != null) {
this.subWeights = new Weights[weights.subWeights.length];
for (int i = 0 ; i < weights.subWeights.length ; i++) {
if (weights.subWeights[i] != null) {
this.subWeights[i] = (Weights) weights.subWeights[i].clone();
}
}
} else {
this.subWeights = new Weights[this.weights.getNbAttributes()];
}
......
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