WITH expected a TRUE/FALSE block, but got a TRUE/FALSE instead?

I have the code

sum [plant-energy] of (patches-with-ash with (pycor > 0 and pxcor > 0)))

for a monitor in my model. plant-energy is a defined patch variable and patches-with-ash is a defined agentset. I'm trying to get a sum of all plant energies for the patches in patches-with-ash in the top-right half of the space, but this returns a weird error.

WITH expected this input to be a TRUE/FLASE block, but got a TRUE/FALSE instead

Any help would be much appreciated!


I'm just using the monitor as a test for my code. I'm trying to sum the plant energy of all patches in the agentset with xcor less than and ycor greater than a turtle (i.e. all patches of this agentset to the upper left of the turtle). I think this is the right avenue to go down but if anyone knows a better way I would appreciate that as well!

1 answer

  • answered 2018-03-13 23:26 JenB

    try it like this:

    sum [plant-energy] of (patches-with-ash with [pycor > 0 and pxcor > 0]))

    The [] basically tells NetLogo to do the test within the [] and return a true or false, which is then passed to the with