title: NetLogo consumer behaviour model
body: <p>I'll give you a brief description of my model:</p>
  <p>turtles can be red or green, omnivores and vegetarian respectively</p>
  <p>two markets (blue squares): meat and substitutes (products that can be consumed instead of meat) market</p>
  <p>When I run the model I would like that turtles start to buy meat or substitutes (only when they are in one of the two markets and based on the market they are in), if they are vegetarian and buy meat turn red while if they stop buying meat and buy only substitutes turn them green (after a certain amount of ticks, which I did not decide yet, they can be considered vegetarian).</p>
  <pre><code>to go
    move-turtles
    market
    tick
  end
  
  to market
    ask turtles
    [ ifelse pcolor = blue
      [buy]
      [right random 360 forward 1]
    ]
  end
  
  to buy
      if market-patches [set money money - Meat-Price]
      if market-patches1  [set money money - Substitutes-Price]  
      if money = 0 [stop]
  end
  </code></pre>
  <p>I do not understand why when I try to run the model it gives me this error back, and I'm sure the error is contained in the last 3 ifs statements:</p>
  <blockquote>
  <p>IF expected input to be a TRUE/FALSE but got the patch (patch 12 11) instead.</p>
  </blockquote>
  <p>Also if you can help me to structure the go procedure I will be eternally grateful.</p>
  <p>This is the overview of the model:
  <a href="https://i.stack.imgur.com/4TVM0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4TVM0.png" alt="model" /></a></p>