lundi 12 juin 2017

How to make a random binary list of lenght 67

This is my first post here (as is my first work with netlogo) so I'll try to be concise:

I'm trying to write a list for my turtles like Epstein and Axtell did in GAS (p. 73).

Until now I tried this with no results.

to setup-culture-tags                                     ;set variable
  let initial-culture-tags n-values 67 [ random 2 ]       ;create a random 
                                                           binary list of 67 
  set culture-tags initial-culture-tags                   ;
end

After making the list I would like to classify these based on the number of 0s. For example "00011" would be "blue" and "00111" would be "red".

The idea here is to give the turtles a random binary list of length 67. Then, they'll interact and change its values based on "tag-flipping": For each neighbor, a tag is randomly selected. If the neighbour agrees with the agent at that position, no change is made; if they disagree, the neighbor's tag is flipped to agree with the agent's tag.

I don't know if this is a stupid question but I'm beginning to feel frustrated so I would appreciate a little help.




Aucun commentaire:

Enregistrer un commentaire