enter image description hereI am new to anylogic and java. When integrating my system dynamics model from vensim I keep getting an operator error on one of my logic variables that sums up other variables and then tests whether a threshold has been breached: Vensim code; IF THEN ELSE( (Catchment hydrostaticity+Storm surge+Wave run up+(Tide+0.93))>1.86, (Catchment hydrostaticity+Storm surge+Wave run up+(Tide+0.93)),1.86) Which should translate in anylogic to; (Catchment_hydrostaticity+Storm_surge+Wave_run_up+Tide+0.93) > 1.86 ? (Catchment_hydrostaticity+Storm_surge+Wave_run_up+Tide+0.93) : 1.86 However, I get the syntax error message: "The operator + is undefined for the argument type(s) double, TableFunction". Now, I am new to java and have tried a few options but with no luck. Does anyone have any ideas why I cannot add these variables together? The units are all the same. Any help is greatly appreciated.
Asked
Active
Viewed 51 times
1 Answers
0
One of the variables you are trying to sum seems to be a "TableFunction" object. For that, you need to call it with an argument (the x-axis value) to get a sum-able value from it (the y-axis value corresponding to your x-axis argument). That you will be able to sum.
Check out the help on TableFunction objects to learn more. Or make sure to not have table functions and turn all your variables into clean double variables :-)
hope this pushes you in the right direction

Benjamin
- 10,603
- 3
- 16
- 28
-
Thanks, Benjamin. I will give it a try. As the y values are the corresponding timestep values of the model run, I hope this is achievable. Thus the table is merely a time-varying input. – Ashton Feb 07 '19 at 19:58
-
Here is what I am trying to do in the attached figure. I have since added a lookup function which still does not seem to work. – Ashton Feb 07 '19 at 20:48
-
"still does not seem to work" is not very helpful. Your screenshot does also not help. Please refer to https://stackoverflow.com/help/how-to-ask to turn this into a clear question. Very happy to help :-) – Benjamin Feb 08 '19 at 13:07