Integrating vensim into anylogic but coming up with opreator error

66 Views Asked by At

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.

1

There are 1 best solutions below

3
On

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