Commit 7482508b authored by balanche's avatar balanche

work in progess : cleaning of the old distance implementation

parent 965162f4
This diff is collapsed.
...@@ -1199,12 +1199,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen ...@@ -1199,12 +1199,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
out.closeEntry(); out.closeEntry();
} }
out.putNextEntry(new ZipEntry(name + '/' + "ParameterMode.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getMode());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser")); out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
oos = new ObjectOutputStream(out); oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom()); oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
...@@ -1311,12 +1305,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen ...@@ -1311,12 +1305,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
out.closeEntry(); out.closeEntry();
} }
out.putNextEntry(new ZipEntry(name + '/' + "ParameterMode.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getMode());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser")); out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
oos = new ObjectOutputStream(out); oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom()); oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
......
...@@ -941,20 +941,22 @@ public class ClassifierPanel extends JPanel { ...@@ -941,20 +941,22 @@ public class ClassifierPanel extends JPanel {
ClassificationWeights weights = new GlobalWeights(data); ClassificationWeights weights = new GlobalWeights(data);
if (this.attributeSelectionPanel != null)
weights = this.attributeSelectionPanel.getWeights();
DistanceModel model = null; DistanceModel model = null;
/* generates model */ /* generates model */
if (this.useNaiveDist) { if (this.useNaiveDist) {
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN); // AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN);
model = DistanceModel.generateNaiveModel(data.getOneDataObject()); model = DistanceModel.generateNaiveModel(data.getOneDataObject(), weights);
} }
else { else {
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.DTW_BARYCENTRE); // AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.DTW_BARYCENTRE);
model = DistanceModel.generateDefaultModel(data.getOneDataObject()); model = DistanceModel.generateDefaultModel(data.getOneDataObject(), weights);
} }
if (this.attributeSelectionPanel != null)
weights = this.attributeSelectionPanel.getWeights();
int choice = this.modele.getSelectedApproach(); int choice = this.modele.getSelectedApproach();
...@@ -1042,7 +1044,6 @@ public class ClassifierPanel extends JPanel { ...@@ -1042,7 +1044,6 @@ public class ClassifierPanel extends JPanel {
else { else {
distanceParameters[th][i] = EmptyDistanceParameter.getInstance();//no parameter for a numerical euclidean distance distanceParameters[th][i] = EmptyDistanceParameter.getInstance();//no parameter for a numerical euclidean distance
averageParameters[i] = EmptyAverageParameter.getInstance(); averageParameters[i] = EmptyAverageParameter.getInstance();
} }
i++; i++;
} }
......
...@@ -10,7 +10,11 @@ import javax.swing.*; ...@@ -10,7 +10,11 @@ import javax.swing.*;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import jcl.data.Data; import jcl.data.Data;
import jcl.data.attribute.Attribute;
import jcl.data.attribute.AttributeMultiDimSequence; import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.Distance;
import jcl.data.distance.DistanceParameter;
import jcl.data.distance.sequential.DistanceEuclidean;
import jcl.learning.LearningParameters; import jcl.learning.LearningParameters;
import jcl.learning.methods.multistrategy.samarah.*; import jcl.learning.methods.multistrategy.samarah.*;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
...@@ -151,7 +155,11 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage ...@@ -151,7 +155,11 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
else { else {
file += "\t\t<isSimplifySequence>true</isSimplifySequence>\n"; file += "\t\t<isSimplifySequence>true</isSimplifySequence>\n";
} }
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN) { for (Distance<Attribute, DistanceParameter> d : agent.getParams().getModel().getDistances()) {
if(!(d instanceof DistanceEuclidean))
}
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN && agent.getParams().getModel()) {
file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n"; file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n";
} }
else { else {
......
...@@ -534,12 +534,6 @@ public class ImageData extends SimpleData implements Serializable { ...@@ -534,12 +534,6 @@ public class ImageData extends SimpleData implements Serializable {
this.resolution = resolution; this.resolution = resolution;
} }
private void setProperties(int mode, int simplifyFrom) {
AttributeMultiDimSequence.setMode(mode);
AttributeMultiDimSequence.setSimplifyFrom(simplifyFrom);
}
/** /**
* <p> * <p>
* Converts this object in a displayble string. * Converts this object in a displayble string.
......
This diff is collapsed.
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