Commit 4a9a8141 authored by lafabregue's avatar lafabregue

changed to a proper implementation

parent 0a2d9516
......@@ -27,40 +27,43 @@ import jcl.utils.exceptions.MethodNotImplementedException;
public abstract class LearningMethod implements Progressable, Cloneable,
Serializable {
/** */
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/** Parametres de la methode de classification */
public LearningParameters parameters = null;
public LearningParameters parameters = null;
/**
* Parametre de progression pour l'affichage eventuel d'une barre de
* progression
*/
public int progress = 0;
protected int progress = 0;
/** Valeur maximale de la progression */
public int progressM = 100;
protected int progressM = 100;
/** Name of the current step of learning */
private String statusName = "Learning";
/** Exemples a utiliser pour l'apprentissage, peut etre nul */
public Vector samples = null;
public Vector samples = null;
/** rmi utilise ou non */
transient public boolean useRmi = false;
transient public boolean useRmi = false;
/** les config du server rmi */
transient public RmiServer rmiServer = null;
transient public RmiServer rmiServer = null;
/**
* Liste des Viewers pour l'affichage des resultats, le calculs de
* statistiques, etc.
*/
public Vector<Viewer> viewers = null;
public Vector<Viewer> viewers = null;
/** panel ou il faut afficher la non disponibiliter du server rmi */
transient public JInternalFrame container_;
transient public JInternalFrame container_ = null;
/** paramtre de la connection ssh si besoin */
public SSHParameters sshparameters = null;
public SSHParameters sshparameters = null;
/**
* <p>
......@@ -126,6 +129,7 @@ public abstract class LearningMethod implements Progressable, Cloneable,
* Fin de la progression.
* </p>
*/
@Override
public void endProgress() {
this.progress = this.progressM;
}
......@@ -198,6 +202,7 @@ public abstract class LearningMethod implements Progressable, Cloneable,
*
* @return le compteur de progression
*/
@Override
public int getProgress() {
return (int) (((double) this.progress / (double) this.progressM) * 100.0);
}
......@@ -242,6 +247,7 @@ public abstract class LearningMethod implements Progressable, Cloneable,
* Incrementation du niveau de progression.
* </p>
*/
@Override
public void incProgress() {
this.progress++;
}
......@@ -294,7 +300,7 @@ public abstract class LearningMethod implements Progressable, Cloneable,
/**
* affichage dans la console, deux cas possible: execution local, algorithme
* effetue par le client, affichage direct. execution deporte, renvoie du
* resultat par RMI TODO:isServer peut etre supprimer.
* resultat par RMI
*
* @param s
*/
......@@ -331,6 +337,7 @@ public abstract class LearningMethod implements Progressable, Cloneable,
* Remise e zero du niveau de progression.
* </p>
*/
@Override
public void resetProgress() {
this.progress = 0;
}
......@@ -356,9 +363,24 @@ public abstract class LearningMethod implements Progressable, Cloneable,
* @param value
* la nouvelle valeur du compteur de progression
*/
@Override
public void setProgress(final int value) {
this.progressM = value;
}
@Override
public void setStatus(String status)
{
statusName = status;
}
@Override
public String getStatus()
{
return statusName;
}
/**
* <p>
......
......@@ -165,18 +165,4 @@ public class ClassifierUnified extends LearningMethod implements Cloneable {
"Method split() not yet implemented.");
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -114,18 +114,4 @@ public class ClassifierAHC extends LearningMethod {
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -707,18 +707,4 @@ public class ClassifierCobweb extends LearningMethod implements Cloneable,
public int getType() {
return ClassifierUtils.COBWEB;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -75,17 +75,4 @@ public class ClassifierCure extends LearningMethod {
throw new MethodNotImplementedException();
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -105,18 +105,4 @@ public class ClassifierEM extends LearningMethod implements Serializable {
final int n) throws MethodNotImplementedException {
throw new MethodNotImplementedException();
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -145,18 +145,4 @@ public class ClassifierEvidence extends LearningMethod implements Serializable {
return str;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -628,19 +628,4 @@ public class ClassifierGNG extends LearningMethod {
return wn;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -442,18 +442,4 @@ public class ClassifierKmeans extends LearningMethod {
return result;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -102,18 +102,4 @@ public class ConstraintKmeans extends LearningMethod {
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -93,19 +93,4 @@ public class LocalKmeans extends LearningMethod {
// TODO Auto-generated method stub
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -93,19 +93,4 @@ public class HiddenKmeans extends LearningMethod {
// TODO Auto-generated method stub
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -233,18 +233,4 @@ public class ClassifierKmeansGenetic extends LearningMethod {
}
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -219,18 +219,4 @@ public class ClassifierOTBKmeans extends LearningMethod{
}
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -66,7 +66,7 @@ public class SeededKmeans extends LearningMethod {
// affectation des classes
result.clusterAffectation(data);
this.display();
this.progress += 1;
this.incProgress();
}
return result;
......@@ -95,18 +95,4 @@ public class SeededKmeans extends LearningMethod {
// TODO Auto-generated method stub
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -188,18 +188,4 @@ public class ClassifierKmedoids extends LearningMethod {
}
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -134,19 +134,4 @@ public class ClassifierPerceptron extends LearningMethod {
final int n) throws MethodNotImplementedException {
throw new MethodNotImplementedException();
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
return null;
// TODO Auto-generated method stub
}
}
......@@ -140,18 +140,4 @@ public class ClassifierRandom extends LearningMethod implements Serializable {
return str;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -142,18 +142,4 @@ public class ClassifierSOM extends LearningMethod implements Serializable {
final int n) throws MethodNotImplementedException {
throw new MethodNotImplementedException();
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -220,18 +220,4 @@ public class WrapperFeatureRanking extends Wrapper {
public String toString() {
return this.parameters.getLearningMethodName();
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -222,18 +222,4 @@ public class ClassifierEvoSamarah extends LearningMethod {
// TODO Auto-generated method stub
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -242,17 +242,4 @@ public class ClassifierCoEvoSamarah extends LearningMethod {
return null;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -128,19 +128,4 @@ public class ClassifierMaclac extends ClassifierModular {
public int getType() {
return ClassifierUtils.MACLAW;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -212,19 +212,4 @@ public class ClassifierMaclae extends ClassifierModular {
public int getType() {
return ClassifierUtils.MACLAW;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -209,18 +209,4 @@ public class ClassifierMaclaw extends ClassifierModular {
public int getType() {
return ClassifierUtils.MACLAW;
}
@Override
public void setStatus(String status)
{
// TODO Auto-generated method stub
}
@Override
public String getStatus()
{
// TODO Auto-generated method stub
return null;
}
}
......@@ -1048,8 +1048,8 @@ public class HybridClassification extends Classification implements Runnable {
/**
* @see SamarahConfig.setAdvancedParameters
*/
public void setAdvancedParameters(double degradation, double classRatio, int solutionType, double kIntern, double kExtern, int unificationType,
int criterion) {
public void setAdvancedParameters(double degradation, double classRatio, int solutionType, double kIntern,
double kExtern, int unificationType, int criterion) {
config.setAdvancedParameters(degradation, classRatio, solutionType, kIntern, kExtern, unificationType, criterion);
}
......
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