samedi 26 septembre 2020

NetLogo IF statement color change

Hi im building my first NetLogo model and this is a statement I want to have inside my code

If a calm agent meets an agitated agent with a different vote there is a 20% chance that the calm agent will change opinion.

there are 2 breeds called group1 and group2 with their own color which is red and blue. The color represents their vote. Each agent is either calm or agitated.

ask turtles [ifelse calm <= agigated 20% 
  [set opposite turtle color]
] 

Im not sure how to write it this is the best I can do.

Aucun commentaire:

Enregistrer un commentaire