1

for one variable in my System Dynamics Model in NetLogo i would like to have more than one boolean in my ifelse-value.

I tried it with the following code that I used as the expression for the variable.

(ifelse-value
    quality = 100 [ 1.1 ]
    quality = 80 [ 1.4 ]
    quality = 60 [ 0.8 ]
               [ 0.7 ])

I got the following error:

IFELSE-VALUE expected 3 inputs, a TRUE/FALSE, a reporter block and a reporter block. 

What am I doing wrong?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
loet23
  • 21
  • 2
  • 1
    That code looks right to me assuming you have a variable named `quality` defined somewhere. Are you using at least NetLogo 6.1? The multi-clause version of `ifelse-value` it was added in that release. Docs: https://ccl.northwestern.edu/netlogo/docs/dictionary.html#ifelse-value – Jasper Feb 09 '21 at 21:59
  • Thanks for your quick response! I have a stock named quality which is linked to the variable. I didn't know about the new version of NetLogo, I am now using 6.0.4. That might cause the problem! Thank you! – loet23 Feb 09 '21 at 22:08

0 Answers0