]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
add variable names to value is nan/inf errors for model debugging 32/4332/1
authorJani Mäkinen <jani.makinen@semantum.fi>
Wed, 1 Jul 2020 12:19:18 +0000 (15:19 +0300)
committerJani Mäkinen <jani.makinen@semantum.fi>
Wed, 1 Jul 2020 12:19:18 +0000 (15:19 +0300)
gitlab #66

Change-Id: Ibd94778043c07acef6310554ed8ebbd60caeb6e9

bundles/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Assignment.java
bundles/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Solver.java

index 2a49d408bdf4f875ec1440536bc00ce9aaea828d..58cbf532ea224d9549ca6e71d96516cd97192c2f 100644 (file)
@@ -67,11 +67,11 @@ public class Assignment {
                        if(value instanceof Double) {\r
                                if(Double.isNaN((Double)value)) {\r
                                        System.err.println("value is invalid (NaN): " + var.base.name);\r
-                                       throw new IllegalStateException("value is invalid (NaN)");\r
+                                       throw new IllegalStateException("value is invalid (NaN): " + var.base.name);\r
                                }\r
                                if(Double.isInfinite((Double)value)) {\r
                                        System.err.println("value is invalid (Infinite): " + var.base.name);\r
-                                       throw new IllegalStateException("value is invalid (Infinite)");\r
+                                       throw new IllegalStateException("value is invalid (Infinite): " + var.base.name);\r
                                }\r
                        }\r
                        if(value instanceof Array) {\r
index 61e7ec2ec2f367f0e49abca054d1680cad33c2ef..e7925b48bae0fca2cfdc6c87d66a4080219122c9 100644 (file)
@@ -54,11 +54,11 @@ public class Solver {
                        if(value instanceof Double) {\r
                                if(Double.isNaN((Double)value)) {\r
                                        System.err.println("value is invalid (NaN): " + var.base.name);\r
-                                       throw new IllegalStateException("value is invalid (NaN)");\r
+                                       throw new IllegalStateException("value is invalid (NaN): " + var.base.name);\r
                                }\r
                                if(Double.isInfinite((Double)value)) {\r
                                        System.err.println("value is invalid (Infinite): " + var.base.name);\r
-                                       throw new IllegalStateException("value is invalid (Infinite)");\r
+                                       throw new IllegalStateException("value is invalid (Infinite): " + var.base.name);\r
                                }\r
                        }\r
                        if(value instanceof Array) {\r