Author: chatellier Date: 2009-03-11 11:29:21 +0000 (Wed, 11 Mar 2009) New Revision: 1937 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java isis-fish/trunk/src/test/java/fr/ifremer/TestUtils.java isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java Log: Call analyseResult after all simulation ends. Still miss simulation scenario. Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2009-03-11 11:26:00 UTC (rev 1936) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2009-03-11 11:29:21 UTC (rev 1937) @@ -1,6 +1,6 @@ /* *##% - * Copyright (C) 2005 - * Ifremer, Code Lutin, Cᅵdric Pineau, Benjamin Poussin + * Copyright (C) 2005 - 2009 + * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -17,18 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *##%*/ -/* * - * SimulationStorage.java - * - * Created: 17 aoᅵt 2005 03:48:50 CEST - * - * @author Benjamin POUSSIN <poussin at codelutin.com> - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - package fr.ifremer.isisfish.datastore; import static org.codelutin.i18n.I18n._; @@ -61,53 +49,61 @@ import fr.ifremer.isisfish.vcs.VCSException; /** - * Class permettant la gestion de la persistance d'une simulation + * Class permettant la gestion de la persistance d'une simulation. * - * @author poussin + * Created: 17 août 2005 03:48:50 CEST * + * @author Benjamin POUSSIN <poussin at codelutin.com> + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ */ public class SimulationStorage extends DataStorage { // SimulationStorage - static final public String SIMULATION_PATH = "simulations"; - static final public String INFORMATION_FILENAME = "information"; - static final public String PARAMETERS_FILENAME = "parameters.properties"; - static final public String RESULT_XML_FILENAME = "isis-mexico-output.xml"; - static final public String RESULT_EXPORT_DIRECTORY = "resultExports"; + public static final String SIMULATION_PATH = "simulations"; + public static final String INFORMATION_FILENAME = "information"; + public static final String CONTROL_FILENAME = "control"; + public static final String PARAMETERS_FILENAME = "parameters.properties"; + public static final String RESULT_XML_FILENAME = "isis-mexico-output.xml"; + public static final String RESULT_EXPORT_DIRECTORY = "resultExports"; - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(SimulationStorage.class); + private static Log log = LogFactory.getLog(SimulationStorage.class); /** cache des simulation storage */ @SuppressWarnings("unchecked") - static protected Map<String, SimulationStorage> simulations = - (Map<String, SimulationStorage>) new ReferenceMap(); + protected static Map<String, SimulationStorage> simulations = (Map<String, SimulationStorage>) new ReferenceMap(); /** some free information, that user can add during simulation */ protected SimulationInformation information = null; protected SimulationParameter parameter = null; - transient protected ResultStorage resultStorage = null; + protected transient ResultStorage resultStorage = null; /** represent the category used for logging in simulation */ public static String LOG_CATEGORY = "fr.ifremer.isisfish.simulator"; /** flag to says if simulation is actually using a simulation logger */ protected boolean useLog; + + protected transient File simulationControlFile = null; + /** * Pour la lecture d'une simulation existante * @param directory repertoire de base du storage (inclu le nom de la sim) * @param name le nom de la simulation * @param parameter les paramètres de la simulation */ - protected SimulationStorage(File directory, String name, SimulationParameter parameter){ + protected SimulationStorage(File directory, String name, + SimulationParameter parameter) { super(directory, name); setParameter(parameter); } - + /** * Retourne le repertoire de base de stockage des simulations * @return */ - static public File getSimulationDirectory() { + public static File getSimulationDirectory() { File result = IsisFish.config.getDatabaseDirectory(); result = new File(result, SIMULATION_PATH); if (!result.exists()) { @@ -136,7 +132,7 @@ * @param root le repertoire de stockage de la simulation * @return */ - static public File getResultExportDirectory(File root) { + public static File getResultExportDirectory(File root) { File result = new File(root, RESULT_EXPORT_DIRECTORY); if (!result.exists()) { result.mkdirs(); @@ -149,32 +145,32 @@ * @param root le repertoire de stockage de la simulation * @return */ - static public File getSimulationParametersFile(File root) { + public static File getSimulationParametersFile(File root) { File result = new File(root, PARAMETERS_FILENAME); return result; } - + /** * Retourne le fichier de stockage des inforations de la simulation * @param root le repertoire de stockage de la simulation * @return */ - static public File getSimulationInformationFile(File root) { + public static File getSimulationInformationFile(File root) { File result = new File(root, INFORMATION_FILENAME); return result; } - + /** * Retourne le fichier de stockage des resultats sous format XML mexico * de la simulation * @param root le repertoire de stockage de la simulation * @return */ - static public File getSimulationResultXmlFile(File root) { + public static File getSimulationResultXmlFile(File root) { File result = new File(root, RESULT_XML_FILENAME); return result; } - + /** * Retourne le fichier de stockage des parametres de la simulation courante * @return @@ -184,7 +180,6 @@ return result; } - protected transient File simulationControlFile = null; /** * Retourne le fichier de stockage du fichier de control de la simulation. * Ce fichier conserve l'etat de la simulation, cela permet a un processus @@ -193,11 +188,11 @@ */ protected File getSimulationControlFile() { if (simulationControlFile == null) { - simulationControlFile = new File(getDirectory(), "control"); + simulationControlFile = new File(getDirectory(), CONTROL_FILENAME); } return simulationControlFile; } - + /** * Retourne le fichier de stockage du fichier de control de la simulation. * Ce fichier conserve l'etat de la simulation, cela permet a un processus @@ -205,7 +200,7 @@ * @return */ protected static File getSimulationControlFile(String id) { - File result = new File(getSimulationDirectory(id), "control"); + File result = new File(getSimulationDirectory(id), CONTROL_FILENAME); return result; } @@ -226,7 +221,7 @@ // car simplement utilise pour indique l'etat de simulation log.warn("Can't save control", eee); } - } + } /** * Reli le fichier contenant les infos de SimulationControl, en excluant @@ -236,11 +231,12 @@ * @param control le control a mettre a jour en fonction de ce qui est lu * @param exclude les champs a exclure */ - public static void readControl(String id, SimulationControl control, String... exclude) { + public static void readControl(String id, SimulationControl control, + String... exclude) { File file = getSimulationControlFile(id); readControl(file, control, exclude); } - + /** * Reli le fichier contenant les infos de SimulationControl, en excluant * certain champs. @@ -249,7 +245,8 @@ * @param control le control a mettre a jour en fonction de ce qui est lu * @param exclude les champs a exclure */ - public static void readControl(File controlFile, SimulationControl control, String... exclude) { + public static void readControl(File controlFile, SimulationControl control, + String... exclude) { try { Properties prop = new Properties(); if (controlFile.exists()) { @@ -263,10 +260,10 @@ prop.remove(e); } control.updateFromProperties(prop); - } - else { - if(log.isDebugEnabled()) { - log.debug("Control file '" + controlFile.getAbsolutePath() + "'doesn't exists"); + } else { + if (log.isDebugEnabled()) { + log.debug("Control file '" + controlFile.getAbsolutePath() + + "'doesn't exists"); } } } catch (Exception e) { @@ -289,7 +286,8 @@ prop.store(out, "Parameters"); out.close(); } catch (IOException eee) { - throw new IsisFishRuntimeException(_("isisfish.error.save.simulation.parameters", file ), eee); + throw new IsisFishRuntimeException(_( + "isisfish.error.save.simulation.parameters", file), eee); } } } @@ -300,15 +298,16 @@ * @return Parameter property. */ public SimulationParameter getParameter() { - if(parameter == null){ + if (parameter == null) { Properties prop = new Properties(); File file = getSimulationParametersFile(); - + // log - if(log.isDebugEnabled()) { - log.debug("Loading properties from : " + file.getAbsolutePath()); + if (log.isDebugEnabled()) { + log.debug("Loading properties from : " + + file.getAbsolutePath()); } - + try { FileInputStream in = new FileInputStream(file); prop.load(in); @@ -316,7 +315,8 @@ parameter = new SimulationParameter(); parameter.fromProperties(getDirectory(), prop); } catch (IOException eee) { - throw new IsisFishRuntimeException(_("isisfish.error.read.simulation.parameters", file), eee); + throw new IsisFishRuntimeException(_( + "isisfish.error.read.simulation.parameters", file), eee); } } return this.parameter; @@ -345,7 +345,8 @@ parameter = new SimulationParameter(); parameter.fromProperties(getDirectory(), prop); } catch (IOException eee) { - throw new IsisFishRuntimeException(_("isisfish.error.read.simulation.parameters", file), eee); + throw new IsisFishRuntimeException(_( + "isisfish.error.read.simulation.parameters", file), eee); } return this.parameter; } @@ -378,7 +379,7 @@ } return resultStorage; } - + /** * Indique si la simulation demandée existe ou non * @param name le nom de la simulation à tester @@ -396,7 +397,7 @@ * @param name le nom de la simulation à tester * @return true si la simulation existe déjà */ - static public boolean localyExists(String name) { + public static boolean localyExists(String name) { return getSimulationNames().contains(name); } @@ -405,7 +406,7 @@ * @param name name of the required simulation * @return la simulation souhaitée ou null si la simulation n'existe pas */ - static public SimulationStorage getSimulation(String name) { + public static SimulationStorage getSimulation(String name) { SimulationStorage result = simulations.get(name); if (result == null) { // recherche du repertoire de la simulation en fonction de la config @@ -431,22 +432,26 @@ * @throws IllegalArgumentException si le nom existe déjà en tant que * simulation */ - static public SimulationStorage create(String name, SimulationParameter parameter) throws StorageException { + public static SimulationStorage create(String name, + SimulationParameter parameter) throws StorageException { if (localyExists(name)) { - throw new IllegalArgumentException("Can't create simulation this simulation name exists: " + name); + throw new IllegalArgumentException( + "Can't create simulation this simulation name exists: " + + name); } File directory = getSimulationDirectory(name); - SimulationStorage result = new SimulationStorage(directory, name, parameter); + SimulationStorage result = new SimulationStorage(directory, name, + parameter); // 20060819: poussin // don't create schema, schema is created during data import from region -// try { -// TopiaContext context = result.getStorage().beginTransaction(); -// context.createSchema(); -// context.commitTransaction(); -// } catch (TopiaException eee) { -// throw new StorageException("Can't create new Region", eee); -// } + // try { + // TopiaContext context = result.getStorage().beginTransaction(); + // context.createSchema(); + // context.commitTransaction(); + // } catch (TopiaException eee) { + // throw new StorageException("Can't create new Region", eee); + // } simulations.put(name, result); return result; @@ -456,7 +461,7 @@ * Retourne la liste des noms de toutes les régions disponible en local * @return la liste des noms de toutes les régions disponible en local */ - static public List<String> getSimulationNames() { + public static List<String> getSimulationNames() { File dir = getSimulationDirectory(); return getStorageNames(dir); } @@ -466,7 +471,7 @@ * ne sont pas encore sur le serveur CVS * @return liste de noms de simulations */ - static public List<String> getNewSimulationNames() { + public static List<String> getNewSimulationNames() { List<String> result = getSimulationNames(); result.removeAll(getRemoteSimulationNames()); return result; @@ -479,7 +484,7 @@ * serveur CVS. Si le serveur n'est pas disponible la liste retournée * est vide. */ - static public List<String> getRemoteSimulationNames() { + public static List<String> getRemoteSimulationNames() { File dir = getSimulationDirectory(); return getRemoteStorageNames(dir); } @@ -489,7 +494,7 @@ * serveur CVS qui ne sont pas encore en local * @return liste de noms de simulations */ - static public List<String> getNewRemoteSimulationNames() { + public static List<String> getNewRemoteSimulationNames() { List<String> result = getRemoteSimulationNames(); result.removeAll(getSimulationNames()); return result; @@ -501,12 +506,12 @@ * @return * @throws StorageException */ - static public FisheryRegion getFisheryRegion(TopiaContext context) - throws StorageException { + public static FisheryRegion getFisheryRegion(TopiaContext context) + throws StorageException { FisheryRegion result; try { FisheryRegionDAO regionDAO = IsisFishDAOHelper - .getFisheryRegionDAO(context); + .getFisheryRegionDAO(context); List<FisheryRegion> regions = regionDAO.findAll(); if (regions.size() != 1) { throw new StorageException("Invalide region database" @@ -539,7 +544,8 @@ tx.commitTransaction(); return result; } catch (TopiaException eee) { - throw new StorageException(_("isisfish.error.get.fisheryRegion"), eee); + throw new StorageException(_("isisfish.error.get.fisheryRegion"), + eee); } } @@ -550,8 +556,10 @@ * @throws VCSException si problème avec le VCS * @throws TopiaException si problème lors de l'opération sur la base embarquée */ - static public void checkout(String name) throws VCSException, TopiaException { - checkout(IsisFish.config.getDatabaseDirectory(), SIMULATION_PATH + "/" + name); + public static void checkout(String name) throws VCSException, + TopiaException { + checkout(IsisFish.config.getDatabaseDirectory(), SIMULATION_PATH + "/" + + name); SimulationStorage sim = getSimulation(name); File file = sim.getDataBackupFile(); TopiaContext tx = sim.getStorage().beginTransaction(); @@ -560,7 +568,7 @@ tx.closeContext(); } - /* (non-Javadoc) + /* * @see fr.ifremer.isisfish.datastore.DataStorage#rename(java.lang.String) */ @Override @@ -571,19 +579,20 @@ } /** - * import zipped simulation + * Import zipped simulation. * * @param file zipped region file * @return region storage or null * @throws IOException si problème IO lors de la lecture du zip * @throws TopiaException si problème lors de la création du contexte */ - public static SimulationStorage importZip(File file) throws IOException, TopiaException { + public static SimulationStorage importZip(File file) throws IOException, + TopiaException { return importAndRenameZip(file, null); } /** - * import zipped simulation + * Import zipped simulation. * * @param file zipped region file * @param newName new name for the imported simulation @@ -591,15 +600,17 @@ * @throws IOException si problème IO lors de la lecture du zip * @throws TopiaException si problème lors de la création du contexte */ - public static SimulationStorage importAndRenameZip(File file, String newName) throws IOException, TopiaException { - SimulationStorage result = importAndRenameZip(getSimulationDirectory(), file, newName); + public static SimulationStorage importAndRenameZip(File file, String newName) + throws IOException, TopiaException { + SimulationStorage result = importAndRenameZip(getSimulationDirectory(), + file, newName); // put result in cache simulations.put(result.getName(), result); return result; } /** - * import zipped simulation in specific directory, result is not put in cache + * Import zipped simulation in specific directory, result is not put in cache. * * @param directory where we want new simulation storage * @param file zipped region file @@ -608,13 +619,15 @@ * @throws IOException si problème IO lors de la lecture du zip * @throws TopiaException si problème lors de la création du contexte */ - public static SimulationStorage importAndRenameZip(File directory, File file, String newName) throws IOException, TopiaException { + public static SimulationStorage importAndRenameZip(File directory, + File file, String newName) throws IOException, TopiaException { if (!directory.exists()) { directory.mkdirs(); } - if(!directory.isDirectory()) { - throw new IllegalArgumentException(_("directory %s must be a directory", - directory.getAbsolutePath())); + if (!directory.isDirectory()) { + throw new IllegalArgumentException(_( + "directory %s must be a directory", directory + .getAbsolutePath())); } String renameFrom = null; String renameTo = null; @@ -622,11 +635,16 @@ renameFrom = "^.*?/(.*)$"; renameTo = newName + "/$1"; } - log.info(_("Import simulation file %s in directory %s and rename from %s to %s", - file, directory, renameFrom, renameTo)); - String lastEntry = ZipUtil.uncompressAndRename(file, directory, renameFrom, renameTo); + if (log.isInfoEnabled()) { + log.info(_("Import simulation file %s in directory %s and rename from %s to %s", + file, directory, renameFrom, renameTo)); + } + String lastEntry = ZipUtil.uncompressAndRename(file, directory, + renameFrom, renameTo); String name = lastEntry.substring(0, lastEntry.indexOf("/")); - log.info(_("Last entry was %s extract name %s", lastEntry, name)); + if (log.isInfoEnabled()) { + log.info(_("Last entry was %s extract name %s", lastEntry, name)); + } File simDir = new File(directory, name); SimulationStorage result = new SimulationStorage(simDir, name, null); @@ -641,7 +659,7 @@ return result; } - + /** * Extract the region of a given simulation in a * @param regionName the name of the region to export @@ -649,15 +667,16 @@ */ public void extractRegion(String regionName) throws StorageException { - File tmpDir=null; + File tmpDir = null; try { TopiaContext tx = getStorage().beginTransaction(); String oldRegionName = getFisheryRegion(tx).getName(); - + // create a pseudo oldRegionName region - tmpDir = FileUtil.createTempDirectory("extractRegionFromSimulation", ""); + tmpDir = FileUtil.createTempDirectory( + "extractRegionFromSimulation", ""); List<File> forZip = new ArrayList<File>(2); File file1; forZip.add(file1 = new File(tmpDir, oldRegionName)); @@ -675,7 +694,7 @@ // import region with regionName as new name RegionStorage.importAndRenameZip(zipRegion, regionName); - + tx.commitTransaction(); tx.closeContext(); } catch (IOException e) { @@ -697,20 +716,16 @@ * @param scriptLogLevel required min level fro scripts logger * @param libLogLevel required min level for libraries logger */ - public void addSimulationLogger(String simulLogLevel, String scriptLogLevel, String libLogLevel,String threadName ) { + public void addSimulationLogger(String simulLogLevel, + String scriptLogLevel, String libLogLevel, String threadName) { try { - SimulationLoggerUtil.addSimulationAppender( - getSimulationLogFile(), - getAppenderId(), - simulLogLevel, - scriptLogLevel, - libLogLevel, - threadName - ); - useLog=true; + SimulationLoggerUtil.addSimulationAppender(getSimulationLogFile(), + getAppenderId(), simulLogLevel, scriptLogLevel, + libLogLevel, threadName); + useLog = true; } catch (Exception eee) { - useLog=false; + useLog = false; log.warn(_("Can't create simulation logger", eee)); // we do not throw any exception, this is a shame but not required } @@ -719,16 +734,13 @@ /** * this method remove logger for the simulation */ - public void removeSimulationLogger() { + public void removeSimulationLogger() { try { - String appenderId = getAppenderId(); - - SimulationLoggerUtil.removeSimulationAppender(appenderId); - + SimulationLoggerUtil.removeSimulationAppender(appenderId); } finally { - useLog=false; + useLog = false; } } @@ -750,4 +762,3 @@ return root + File.separator + "simulation.log"; } } // SimulationStorage - Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java 2009-03-11 11:26:00 UTC (rev 1936) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java 2009-03-11 11:29:21 UTC (rev 1937) @@ -67,10 +67,10 @@ * Fait une simulation dans la meme jvm. * * @author poussin - * @version $Revision: 1.0 $ + * @version $Revision$ * - * Last update : $Date: 5 mars 2009 $ - * By : $Author: chatellier $ + * Last update : $Date$ + * By : $Author$ */ public class InProcessSimulatorLauncher implements SimulatorLauncher { Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/InProcessSimulatorLauncher.java ___________________________________________________________________ Name: svn:keywords + Revision Author Date Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java 2009-03-11 11:26:00 UTC (rev 1936) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java 2009-03-11 11:29:21 UTC (rev 1937) @@ -25,9 +25,11 @@ import java.io.FileOutputStream; import java.io.IOException; import java.rmi.RemoteException; +import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Properties; import java.util.SortedMap; @@ -46,6 +48,9 @@ import fr.ifremer.isisfish.simulator.SimulationControl; import fr.ifremer.isisfish.simulator.SimulationParameter; import fr.ifremer.isisfish.simulator.launcher.SimulationJob.PostAction; +import fr.ifremer.isisfish.simulator.sensitivity.SensitivityCalculator; +import fr.ifremer.isisfish.simulator.sensitivity.SensitivityException; +import fr.ifremer.isisfish.simulator.sensitivity.SensitivityScenarios; /** * Moniteur singleton pour pouvoir sauvegarder @@ -60,10 +65,10 @@ * * @since 3.2.0.4 * @author chatellier - * @version $Revision: 1.0 $ + * @version $Revision$ * - * Last update : $Date: 28 janv. 2009 $ - * By : $Author: chatellier $ + * Last update : $Date$ + * By : $Author$ */ public class SimulationMonitor extends Thread { @@ -458,6 +463,9 @@ // post manage this storage exportResult(job, simulation); + + // sensitivity calculator analyze result call + analyzeSensitivityResult(job, simulation); } } catch (RemoteException e) { if (log.isErrorEnabled()) { @@ -470,7 +478,6 @@ simulationStop(job); service.fireStopEvent(job); } - } /** @@ -558,6 +565,68 @@ } /** + * For each finished simulation, check that all sensitivity + * simulation are available (in case of sensitivity simulation only). + * + * @param job job + * @param simulation simulation + */ + protected void analyzeSensitivityResult(SimulationJob job, + SimulationStorage simulation) { + + SimulationParameter params = simulation.getParameter(); + + int numberOfSimulation = params.getNumberOfSensitivitySimulation(); + SensitivityCalculator sensitivityCalculator = params.getSensitivityCalculator(); + if (numberOfSimulation > 0 && params.getSensitivityCalculator() != null) { + // this is a sensitivity simulation + String simulationId = job.getId(); + String simulationCommonPrefix = simulationId.substring(0, simulationId.lastIndexOf("_")); + + // simulation start at 0 + List<SimulationStorage> simulationStorageForAnalyze = new ArrayList<SimulationStorage>(); + for (int simulationIndex = 0; simulationIndex < numberOfSimulation ; ++simulationIndex) { + String currentId = simulationCommonPrefix + "_" + simulationIndex; + if (SimulationStorage.localyExists(currentId)) { + SimulationControl currentSimulationControl = new SimulationControl(currentId); + SimulationStorage.readControl(currentId, currentSimulationControl); + + // condiftion for simulation "end" + if (currentSimulationControl.getProgress() > 0 + && currentSimulationControl.getProgress() >= currentSimulationControl.getProgressMax()) { + SimulationStorage storage = SimulationStorage.getSimulation(currentId); + simulationStorageForAnalyze.add(storage); + } + else { + // no need to continue + // if only miss one, break + break; + } + } + } + + // si on a toutes les simulation est qu'elles sont finie + // on construit la liste des simulation storage + // et on l'envoie au script d'analyse de sensibilite + if (simulationStorageForAnalyze.size() == numberOfSimulation) { + if (log.isDebugEnabled()) { + log.debug("Call analyzeResult on sensitivity script " + sensitivityCalculator.getClass().getSimpleName()); + } + try { + // FIXME sensitivityScenarios are not available here :( + SensitivityScenarios sensitivityScenarios = new SensitivityScenarios(); + sensitivityCalculator.analyzeResult(sensitivityScenarios, simulationStorageForAnalyze); + } + catch(SensitivityException e) { + if (log.isErrorEnabled()) { + log.error("Can't call analyse result", e); + } + } + } + } + } + + /** * Convertit une collection de string, en une chaine * séparée par des ",". * Property changes on: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationMonitor.java ___________________________________________________________________ Name: svn:keywords + Revision Date Author Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-03-11 11:26:00 UTC (rev 1936) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SimulationService.java 2009-03-11 11:29:21 UTC (rev 1937) @@ -53,12 +53,10 @@ import org.codelutin.util.ListenerSet; import org.codelutin.util.ObjectUtil; import org.codelutin.util.ZipUtil; -import org.h2.jdbc.JdbcSQLException; import fr.ifremer.isisfish.IsisFish; import fr.ifremer.isisfish.IsisFishRuntimeException; import fr.ifremer.isisfish.datastore.AnalysePlanStorage; -import fr.ifremer.isisfish.datastore.DataStorage; import fr.ifremer.isisfish.datastore.ExportStorage; import fr.ifremer.isisfish.datastore.RegionStorage; import fr.ifremer.isisfish.datastore.RuleStorage; Modified: isis-fish/trunk/src/test/java/fr/ifremer/TestUtils.java =================================================================== --- isis-fish/trunk/src/test/java/fr/ifremer/TestUtils.java 2009-03-11 11:26:00 UTC (rev 1936) +++ isis-fish/trunk/src/test/java/fr/ifremer/TestUtils.java 2009-03-11 11:29:21 UTC (rev 1937) @@ -1,3 +1,21 @@ +/* *##% + * 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; import java.io.File; @@ -16,6 +34,10 @@ * Une classe pour avoir des choses utiles pour tous les tests d'isis * * @author chemit + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ */ public abstract class TestUtils { @@ -32,7 +54,7 @@ base = new File("").getAbsolutePath(); } basedir = new File(base); - System.out.println("basedir for test " + basedir); + //System.out.println("basedir for test " + basedir); } return basedir; } @@ -40,7 +62,7 @@ public static File getTargetdir() { if (targetdir == null) { targetdir = new File(getBasedir(), "target"); - System.out.println("targetdir for test " + targetdir); + //System.out.println("targetdir for test " + targetdir); } return targetdir; } Property changes on: isis-fish/trunk/src/test/java/fr/ifremer/TestUtils.java ___________________________________________________________________ Name: svn:keywords + Revision Date Author Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java =================================================================== --- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java 2009-03-11 11:26:00 UTC (rev 1936) +++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/ui/sensitivity/FactorTreeModelTest.java 2009-03-11 11:29:21 UTC (rev 1937) @@ -153,5 +153,3 @@ } } } - -
participants (1)
-
chatellier@users.labs.libre-entreprise.org