Commit a2c981db authored by lafabregue's avatar lafabregue

small fixes

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