title: Netlogo - Group-level choices
body: <p>I'm new to this Forum and I'm looking forward to hearing from you and, when possible, provide some of my own knowledge.</p>
  
  <p>I'm trying to have turtles in my model decide randomly, but coherently on a group level.</p>
  
  <p>In my model, each turtle has a native language. They are then split in several groups and I want each group to decide on a common language to use which should be the most recurring native language, in other words, the modal language of the group. This usually works smoothly, unless the group has more than one mode, in which case I initially used the "one-of" function, as follows:</p>
  
  <p>To go</p>
  
  <pre><code>ask turtles [ define-majority-language ]
  ...
  </code></pre>
  
  <p>You define-majority-language</p>
  
  <pre><code>  let my-mates turtles with [ my-group = [ my-group ] of myself ]
    set my-group-majority-language one-of modes [ language-spoken ] of my-mates
  end
  </code></pre>
  
  <p>However, I quickly realized that every turtle is making her random "one-of" choice individually, so some group members are going for one and other group members are going for the other, while I want all group members to choose randomly but coherently, i.e. they should all agree on the same language to use. I also tried to make an <code>agentset</code> but there again, members act individually...</p>
  
  <p>How can I do that?</p>