From e4358a1c9b0093a343a359d977e83a9080a2169c Mon Sep 17 00:00:00 2001 From: "jussi.koskela" Date: Fri, 7 Nov 2014 14:03:28 +0000 Subject: [PATCH] (fixes #5470) Possibility to recalculate values of the auxiliary variables without progressing in simulation git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30532 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/fi/semantum/sysdyn/solver/Solver.java | 47 ++++++++++--------- .../sysdyn/manager/SimulateDurationJob.java | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Solver.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Solver.java index d33e12cc..591ba337 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Solver.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Solver.java @@ -240,7 +240,7 @@ public class Solver { public void aboutToRun() { - if(!started && dirty) { + if(!started || dirty) { for(int loop=0;loop<3;loop++) { @@ -259,32 +259,34 @@ public class Solver { // ass.target.assign(env, ass.subscripts, value); } - for(VariableDeclaration vd : model.variables) { - try { - for(Argument arg : vd.modification.args) { - if(arg.name.endsWith("start")) { - Object value = arg.modification.evaluate(env); - if(vd.variable.base.dimension() == 1) { - validate(vd.variable, value); - vd.variable.assign(env, null, value); - } else { - validate(vd.variable, value); - if(value instanceof Double) { - Array array = new Array(); - for(int i=0;i -1.0) duration = base.stepDuration; -- 2.47.1