Author: echatellier Date: 2012-03-05 17:01:04 +0100 (Mon, 05 Mar 2012) New Revision: 3634 Url: http://forge.codelutin.com/repositories/revision/isis-fish/3634 Log: Remove unnecessary api Modified: branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationVariable.java Modified: branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java =================================================================== --- branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2012-03-05 10:52:26 UTC (rev 3633) +++ branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationContext.java 2012-03-05 16:01:04 UTC (rev 3634) @@ -81,7 +81,6 @@ protected Set<SimulationListener> simulationListeners = new LinkedHashSet<SimulationListener>(); protected ClassLoader classLoader = null; protected File scriptDirectory; - protected TimeStep timeStep; /** TopiaContext must be used by rule action to modify data */ protected TopiaContext db = null; @@ -321,26 +320,6 @@ } /** - * Set simulation current time step. - * - * @param timeStep current time step - * @since 4.1.0.0 - */ - public void setTimeStep(TimeStep timeStep) { - this.timeStep = timeStep; - } - - /** - * Get simulation current time step. - * - * @return current time step - * @since 4.1.0.0 - */ - public TimeStep getTimeStep() { - return timeStep; - } - - /** * Script directory to use. * * Used to chnage isis-database-3 directory in running simulation context. @@ -423,59 +402,4 @@ } return v; } - - /** - * Save all cached context values. - * - * @since 4.1.0.0 - */ - public void saveContextValues() { - File exportFile = new File(getScriptDirectory(), "variables.txt"); - - Writer out = null; - try { - out = new FileWriter(exportFile, true); - - out.write("=========== Step : " + timeStep.toString() + " ===========\n"); - for (Map.Entry<TopiaEntity, SimulationVariable> entry : variablesCache.entrySet()) { - TopiaEntity entity = entry.getKey(); - SimulationVariable simVariable = entry.getValue(); - - String name = null; - try { - name = BeanUtils.getProperty(entity, "name"); - } catch (Exception ex) { - name = entity.getTopiaId(); - } - - for (Entry<String, Variable> variableEntry : simVariable.variablesCache.entrySet()) { - Variable variable = variableEntry.getValue(); - - out.write(name + " "); - out.write(variable.getName()); - out.write(" = "); - - switch (variable.getType()) { - case DOUBLE: - out.write(String.valueOf(variable.getDoubleValue())); - break; - case MATRIX: - out.write(variable.getMatrixValue().toString()); - break; - case EQUATION: - out.write(String.valueOf(simVariable.eval(variable))); - break; - } - out.write("\n"); - } - } - out.write("\n\n"); - - out.close(); - } catch (IOException ex) { - throw new IsisFishRuntimeException("Can't save ", ex); - } finally { - IOUtils.closeQuietly(out); - } - } } Modified: branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationVariable.java =================================================================== --- branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationVariable.java 2012-03-05 10:52:26 UTC (rev 3633) +++ branches/4.1/src/main/java/fr/ifremer/isisfish/simulator/SimulationVariable.java 2012-03-05 16:01:04 UTC (rev 3634) @@ -164,7 +164,7 @@ Map<String, Object> args = new HashMap<String, Object>(); args.put("context", simulationContext); args.put("entity", topiaEntity); - args.put("step", simulationContext.getTimeStep()); + args.put("step", simulationContext.getSimulationControl().getStep()); Object val = EvaluatorHelper.evaluate("fr.ifremer.isisfish.equation", topiaEntity.getTopiaId() + "#" + v.getName(), VariableEquation.class,