From: miettinen Date: Fri, 5 Apr 2013 07:34:59 +0000 (+0000) Subject: The single simulation results are now drawn in sensitivity analysis. X-Git-Tag: simantics-1.10~6 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=669deb8246bc922e44834b39c443fbac93a533a3;p=simantics%2Fsysdyn.git The single simulation results are now drawn in sensitivity analysis. Added also two icons but they are not used currently. (refs #4177) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27249 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/icons/bullet_gray.png b/org.simantics.sysdyn.ui/icons/bullet_gray.png new file mode 100644 index 00000000..6f58b930 Binary files /dev/null and b/org.simantics.sysdyn.ui/icons/bullet_gray.png differ diff --git a/org.simantics.sysdyn.ui/icons/bullet_green.png b/org.simantics.sysdyn.ui/icons/bullet_green.png new file mode 100644 index 00000000..1b5409f3 Binary files /dev/null and b/org.simantics.sysdyn.ui/icons/bullet_green.png differ diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynSensitivityAnalysisExperiment.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynSensitivityAnalysisExperiment.java index 4d8816e0..2a0d2c1d 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynSensitivityAnalysisExperiment.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynSensitivityAnalysisExperiment.java @@ -132,10 +132,18 @@ public class SysdynSensitivityAnalysisExperiment extends SysdynExperiment { results = null; // Simulate the model + + /* If the changes is altered, it affects also to the next simulation. So, + * All the parameters that are to be altered need to be defined explicitly + * before each new simulation. + */ + + changes = new HashMap(); + changes.put("Auxiliary1", "444.0"); runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, 0); - + changes.put("Auxiliary1", "333.0"); runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, 1); - + changes.put("Auxiliary1", "222.0"); runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, 2); } if(canceled) @@ -290,6 +298,32 @@ public class SysdynSensitivityAnalysisExperiment extends SysdynExperiment { return this.results; } + @Override + public Collection getActiveResults() { + ArrayList result = new ArrayList(); + result.addAll(getCurrentResults()); + result.addAll(sysdynModel.getDisplayedResults()); + return result; + } + + @Override + public MemoryResult getCurrentResult() { + if (this.results == null || this.results.size() < 1) + return null; + /* There should be a better alternative solution for this. Currently + * the return value is next to nonsense. + */ + return this.results.get(0); + } + + @Override + public void saveState() { + if(results == null || !(results instanceof ArrayList)) + return; + //SaveResultJob saveResultJob = new SaveResultJob(SysdynSensitivityAnalysisExperiment.this, session, results); + //saveResultJob.schedule(); + } + //this.results.add(new MemoryResult(null, null));