r1840 - in isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator: . factors
Author: chatellier Date: 2009-02-19 11:01:06 +0000 (Thu, 19 Feb 2009) New Revision: 1840 Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/package-info.java Log: AJout des classes et interfaces permettant de g?\195?\169rer les facteurs de simulation. Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/DesignPlan.java 2009-02-19 11:01:06 UTC (rev 1840) @@ -0,0 +1,70 @@ +/* *##% + * Copyright (C) 2009 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package fr.ifremer.isisfish.simulator.factors; + +import java.io.Serializable; +import java.util.List; + +/** + * Design plan contenant toutes les + * valeur de facteur possible. + * + * @param <E> type des valeurs gérées par le plan + * + * @author chatellier + * @version $Revision: 1.0 $ + * + * Last update : $Date: 19 févr. 2009 $ + * By : $Author: chatellier $ + */ +public class DesignPlan<E extends Serializable> implements Serializable { + + /** serialVersionUID. */ + private static final long serialVersionUID = 977975461743758075L; + + /** Liste des facteurs a utiliser */ + protected List<Factor<E>> factors; + + /** + * Constructor. + */ + public DesignPlan() { + + } + + /** + * Get factors list. + * + * @return factors list + */ + public List<Factor<E>> getFactors() { + return factors; + } + + /** + * Set factors list. + * + * @param factors the factors list to set + */ + public void setFactors(List<Factor<E>> factors) { + this.factors = factors; + } + + +} Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Factor.java 2009-02-19 11:01:06 UTC (rev 1840) @@ -0,0 +1,104 @@ +/* *##% + * Copyright (C) 2009 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package fr.ifremer.isisfish.simulator.factors; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +/** + * Facteur de variation des parametres de simulation. + * + * @param <E> type des valeurs gérées par le facteur + * + * La classe doit être {@link Serializable} avec ses valeurs + * pour permettre l'export XML. + * + * @author chatellier + * @version $Revision: 1.0 $ + * + * Last update : $Date: 19 févr. 2009 $ + * By : $Author: chatellier $ + */ +public class Factor<E extends Serializable> implements Serializable { + + /** serialVersionUID. */ + private static final long serialVersionUID = 1643804268013964453L; + + /** + * Nom du facteur. + */ + protected String name; + + /** + * Domain du facteur. + * + * Ensemble des valeurs possibles a prendre en compte. + * La clé est un label qui permet d'identifier la valeur. + * + * Le domain peut etre : + * - discret : i.e un ensemble de valeurs + * - continu : i.e, une borne min, max + * + * FIXME min et max pour un domain continu ? + * FIXME domain.size() = 2 ? + */ + protected Map<String, E> domain; + + /** + * Label de la valeur par defaut. + * + * Utilisation différente suivant le cas : + * - avant envoie vers R : valeur par défaut + * - apres, valeur a prendre en compte + */ + protected String valueLabel; + + /** + * Path permettant d'identifier l'objet et + * la propriete de l'objet a mettre a jour. + * + * Par exemple: + * topiaID#gear + * aura pour effet de recuperer l'objet correspondant + * au topiaID fournit et d'appeler le propriete + * <tt>setGear(value)</tt> dessus. + */ + protected String path; + + /** + * Constructor. + * + * Protected, name is mandatory. + */ + protected Factor() { + // impl must be Serializable + domain = new HashMap<String, E>(); + } + + /** + * Constructor with name. + * + * @param name factor name + */ + public Factor(String name) { + this(); + this.name = name; + } +} Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/Scenario.java 2009-02-19 11:01:06 UTC (rev 1840) @@ -0,0 +1,76 @@ +/* *##% + * Copyright (C) 2009 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package fr.ifremer.isisfish.simulator.factors; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * Scenario d'execution de simulation. + * + * @param <E> type des valeurs gérées par le scenario + * + * @author chatellier + * @version $Revision: 1.0 $ + * + * Last update : $Date: 19 févr. 2009 $ + * By : $Author: chatellier $ + */ +public class Scenario<E extends Serializable> implements Serializable { + + /** serialVersionUID. */ + private static final long serialVersionUID = 4953721873692486687L; + + /** + * Ensemble des simulations a executer. + * + * Chaque simulation a un nom, et une liste de facteur. + * + * Chaque facteur a la {@link fr.ifremer.isisfish.simulator.factors.Factor#valueLabel} + * a prendre en compte pour la simulation. + */ + protected Map<String, List<Factor<E>>> simulationsFactors; + + /** + * Constructeur. + */ + public Scenario() { + + } + + /** + * Get simulation Factors. + * + * @return the simulations + */ + public Map<String, List<Factor<E>>> getSimulationsFactors() { + return simulationsFactors; + } + + /** + * Set simulation factors. + * + * @param simulationsFactors the simulations factors to set + */ + public void setSimulationsFactors(Map<String, List<Factor<E>>> simulationsFactors) { + this.simulationsFactors = simulationsFactors; + } + +} Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/StatisticsCalculator.java 2009-02-19 11:01:06 UTC (rev 1840) @@ -0,0 +1,54 @@ +/* *##% + * Copyright (C) 2009 Code Lutin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package fr.ifremer.isisfish.simulator.factors; + +import java.io.Serializable; + +/** + * Interface vers le calculateur statistique. + * + * @author chatellier + * @version $Revision: 1.0 $ + * + * Last update : $Date: 19 févr. 2009 $ + * By : $Author: chatellier $ + */ +public interface StatisticsCalculator { + + /** + * Envoi un plan a faire analyser par l'outils + * statistique. + + * @param plan plan a analyser + * @param <E> type des données du scenario et du plan + * + * @return un Scenario + * @see DesignPlan + * @see Scenario + */ + <E extends Serializable> Scenario<E> getScenario(DesignPlan<E> plan); + + /** + * Ajoute un paramètre pour l'outils statistique. + * + * @param key nom du parametre + * @param value valeur du parametre + */ + void setParameter(String key, String value); +} Added: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/package-info.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/package-info.java (rev 0) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/factors/package-info.java 2009-02-19 11:01:06 UTC (rev 1840) @@ -0,0 +1,12 @@ +/** + * Factors. + * + * Ce package contient les données {@link java.io.Serializable} + * permettant de representer des Facteur de variation à appliquer + * sur les simulations. + * + * Il contient l'interface permettant d'appeler un outils statistique + * comme R (http://www.r-project.org/) ou autre. + */ +package fr.ifremer.isisfish.simulator.factors; +
participants (1)
-
chatellier@users.labs.libre-entreprise.org