]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Getting closer
authorvillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 31 Mar 2014 11:54:34 +0000 (11:54 +0000)
committervillberg <villberg@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 31 Mar 2014 11:54:34 +0000 (11:54 +0000)
refs #4765

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@29225 ac1ea38d-2e2b-0410-8846-a27921b304fc

fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Solver.java
org.simantics.sysdyn.tests/src/org/simantics/sysdyn/tests/scripts/ImportModel_GlobalCarbonCycle.sts
org.simantics.sysdyn.tests/src/org/simantics/sysdyn/tests/scripts/ImportModel_PredatorAndLimitedPrey.sts
org.simantics.sysdyn.tests/src/org/simantics/sysdyn/tests/scripts/ImportModel_TouristsEnvironmentsAndHotelFacilities.sts

index ca56e4bb48762a4e26ea70ac801e391f7bc3dd3f..1a4aed8c9937fafe357a467d5ec678edf6b9ff24 100644 (file)
@@ -266,10 +266,8 @@ public class Solver {
 \r
                // Next solve algebraic equations\r
                for(int i=0;i<assignments.length;i++) {\r
-                       newValues[i] = assignments[i].expression.evaluate(env);\r
-               }\r
-               for(int i=0;i<model.assignments.size();i++) {\r
-                       assignments[i].target.assign(env, assignments[i].subscripts, newValues[i]);\r
+                       Object value = assignments[i].expression.evaluate(env);\r
+                       assignments[i].target.assign(env, assignments[i].subscripts, value);\r
                }\r
 \r
        }\r
index a2c38563775f1a0e147efa80c8f2d2426825b432..d731bc910cc29693c10a86ee4a49619c4590a274 100644 (file)
@@ -6,5 +6,5 @@
 >exp = fromJust $ possibleResourceChild m "Experiment"\r
 >id = activateExperiment exp\r
 >run id\r
->withinEpsilon (lastValue exp id "/Carbon In Biosphere") 2710.705 0.001\r
+>withinEpsilon (lastValue exp id "/Carbon In Biosphere") 2710.604 0.001\r
 True
\ No newline at end of file
index 2aed19ba9ab3a385245cfb566023a895cd7aad11..3d04aaaec68129fcf49a97de20af39e6309c3c14 100644 (file)
@@ -6,5 +6,5 @@
 >exp = fromJust $ possibleResourceChild m "Experiment"\r
 >id = activateExperiment exp\r
 >run id\r
->withinEpsilon (lastValue exp id "/prey") 0.998 0.001\r
+>withinEpsilon (lastValue exp id "/prey") 0.996 0.001\r
 True
\ No newline at end of file
index 8bfd516fcd913680afcbea05928ae739e93f18eb..2db9bd4ae64bf31c731cb5f9cf7f42e5142edf50 100644 (file)
@@ -6,5 +6,5 @@
 >exp = fromJust $ possibleResourceChild m "Experiment"\r
 >id = activateExperiment exp\r
 >run id\r
->withinEpsilon (lastValue exp id "/Tourists") 2674.532 0.001\r
+>withinEpsilon (lastValue exp id "/Tourists") 2642.086 0.001\r
 True
\ No newline at end of file