simple interaction

simple interaction preview image

1 collaborator

Default-person Eleanor Anderson (Author)

Tags

(This model has yet to be categorized with any tags)
Part of project 'Organizational Change Set'
Model group MAM-2013 | Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0.4 • Viewed 728 times • Downloaded 51 times • Run 0 times
Download the 'simple interaction' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

A simple model of a world where turtles change their opinions based on the opinions of those around them.

HOW IT WORKS

Everyone starts with one of two opinions "defender" or "reformer."

At each tick, turtles look at the turtles within the radius of their turtle-vision (including themselves):

  • if the majority were defenders on the last tick, the turtle becomes a defender
  • if the majority were reformer on the last tick, the turtle becomes a reformer.

Turtles can move in 3 ways

  • by walking randomly around the world
  • by moving to a random different location in the world at a certain probability
  • by starting off in groups and having one turtle from each group switch groups at each tick

HOW TO USE IT

Change the vision slider to the radius within which turtles look for a majority.

Change the movement chooser to decide on how turtles move.

If turtles are moving "a few at a time," change the moving-probability slider to determine the chance any turtle will move on a given tick

If turtles are moving in "groups," change the group-size slider to determine how big each group is

THINGS TO NOTICE

The bigger the radius the faster all the turtles come to have the same opinion, but this is the eventual stable result regardless.

Moving "all random" and "a few at a time" seem to get to the same place.

Moving in "groups" looks a bit different.

  • If turtle vision is relatively big, all the turtles in a group end up the same color and this stays constant.
  • If turtle vision is small (e.g. 1.5) all of the groups develop the same pattern of red and blue. Eventually one color takes over but it take a while.

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own 
[ opinion
  current-group ]

patches-own
[ group-center ]

to setup
  clear-all
  create-turtles 100
  [ setxy random-xcor random-ycor 
  set opinion one-of ["reformer" "defender"]
  set current-group 0
  set-colors ]
  if movement = "groups"
  [ group-set ]
  reset-ticks
end 

to set-colors
  if opinion = "defender"
   [ set color blue ]
    if opinion = "reformer"
   [ set color red ] 
end 

;; create evenly sized groups of group-size size
;; do this by selecting a group of turtles of the right size as many times as is needed
;; create a temporary leader of each group
;; kill any turtles that don't fit evenly into groups of the chosen size
;; use leaders to stake out a patch for each group

to group-set
  let number-groups floor (count turtles / group-size )
  let leaders no-turtles
  repeat number-groups 
  [ ask n-of group-size turtles with [ current-group = 0 ]
    [ set current-group number-groups ]
    set leaders (turtle-set leaders (one-of turtles with [current-group = number-groups ]) )
    set number-groups number-groups - 1 ]
  ask turtles with [ current-group = 0 ]
  [ die ]
  layout-circle leaders 13

  ask leaders
  [ ask patch-here 
    [ set group-center [ current-group ] of myself ] ]
  ask turtles
  [ join ]
end 

to join
   move-to one-of patches with [group-center = [ current-group ] of myself ]
   bk 2
end 

to go
  if movement = "groups"
  [ choose-movers ]
  ask turtles
  [ meet-others
    learn
    set-colors ]
  tick
end 

;; identify a group of turtles that will move, one from each group
;; set their current-group to 0

to choose-movers
  let number-groups floor (count turtles / group-size )
  let movers one-of turtles
  let mover-groups (list [ current-group ] of movers )
  while [ length mover-groups < number-groups ]
  [ ask turtles
    [ if not member? current-group mover-groups
      [ set mover-groups ( sentence mover-groups current-group )
        set movers ( turtle-set movers self ) ] ] ]
  ask movers 
  [ set current-group 0 ]
end 

;; turtles interact in different ways, depending on what kind of movement is selected

to meet-others
  if movement = "all random"
  [ wiggle ]
  if movement = "a few at a time"
  [ some-move ]
  if movement = "groups"
  [ group-move ]
end 

to wiggle
  rt random 90
  lt random 90
  fd 1 
end 

to some-move
  let chance random-float 1
  if chance < moving-probability
  [ setxy random-xcor random-ycor ]
end 

to group-move
  ask turtles with [ current-group = 0 ]
  [ choose-again 
    join ]
end 


;; add turtles to groups, making sure they all remain the same size

to choose-again  
  let number-groups floor (count turtles / group-size )
  set current-group 1 + random number-groups
  if count other turtles with [ current-group = [ current-group ] of myself ] > group-size
  [ choose-again ]  
end 


;; turtles take on the opinion of the majority of turtles around them

to learn
  let defenders count turtles in-radius turtle-vision with [ color = blue ]
  let reformers count turtles in-radius turtle-vision with [ color = red ]
  if defenders > reformers 
  [ set opinion "defender" ]
  if reformers > defenders 
  [ set opinion "reformer" ]
end 

There are 2 versions of this model.

Uploaded by When Description Download
Eleanor Anderson over 12 years ago added 3 types of turtle movement Download this version
Eleanor Anderson over 12 years ago Initial upload Download this version

Attached files

File Type Description Last updated
EleanorAnderson_ 5 20 13.docx word project update 5 20 13 over 12 years ago, by Eleanor Anderson Download
simple interaction.png preview Preview for 'simple interaction' over 12 years ago, by Eleanor Anderson Download

This model does not have any ancestors.

This model does not have any descendants.