Evolution of Norms

Evolution of Norms preview image

1 collaborator

Default-person Paul Matthews (Author)

Tags

norms, society, sociology 

Tagged by Paul Matthews over 3 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.2.1 • Viewed 299 times • Downloaded 21 times • Run 0 times
Download the 'Evolution of Norms' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

globals[defections turtlecount turtleno punishcount metapunishcount sd mn difft]
turtles-own[points boldness vengefullness seen? punish?]

to setup
  clear-all
  set turtlecount 20
  set defections 0
  addturtles turtlecount 0 0 0
  reset-ticks
end 

to go100
  repeat 100[
   go
  ]
end 

to go

  ask turtles[
    repeat 4[
      set punishcount 0
      set metapunishcount 0

      ;; Chance of being seen
      set seen? random-float 1

      ;; Defect if think you can get away with it
      if seen? < boldness / 7
         [  ;; Choose to defect
           set points points + 3
           set defections defections + 1

          ask other turtles [
            ;; hurt caused by defection
            set points points - 1

              ;; Did they see this?
              if random-float 1 < seen?[
              ;; Yes, they saw it
              set punish? random-float 1
              ;; Are they going to punish?
              ifelse vengefullness / 7 > punish? [
                ;; they also chose to punish
                set punishcount punishcount + 1
                set points points - 2
              ]
              [ ;; They did not punish; Enforce metanorm version?
                if Metanorm[
                  ask other turtles[
                    ;; enforce metanorm?
                    if random-float 1 < seen?[
                       set metapunishcount metapunishcount + 1
                       set points points - 2
                    ]
                  ]
                  set points points - (9 * metapunishcount)
                  set metapunishcount 0
                ]
              ]
            ]

          ]

          ;; Apply punishment to defector
          set points points - (9 * punishcount)
          set punishcount 0

         ]

    ]
  ]

  ;; evolution. Turtles replicate more if successful in strategies
  set sd standard-deviation [points] of turtles
  set mn mean [points] of turtles

  ask turtles[
    ;;show points
    if points >= mn + sd[
      ;; Most successful individuals have 2 offspring
      hatch 2 [
        set points 0
        setxy random 30 random 30
        ]
    ]
    if (points >= mn - sd) and (points < mn + sd) [
      ;; Mean individuals have just one
      hatch 1 [
        set points 0
        setxy random 30 random 30
        ]
      ]
    die
  ]

  ;; even up the numbers to 20
  set difft  turtlecount - count turtles

  ifelse difft < 0[
    repeat difft * -1[
      ask turtle max[who] of turtles [
       die
      ]
    ]
  ][
     addturtles difft 0 0 0
  ]

  ;; mutation
  ask turtles[
    if random-float 1 <= 0.01[
      set boldness random 8
    ]
    if random-float 1 <= 0.01[
      set vengefullness random 8
    ]
  ]

  ;;update-plots

  tick
  set defections 0
end 

to addturtles [num bold venge pts]
  create-turtles num[
    ifelse bold = 0[
      set boldness random 8
    ][
     set boldness bold
    ]
    ifelse venge = 0[
      set vengefullness random 8
    ][
      set vengefullness venge
    ]

    set points pts
    setxy random 30 random 30
    set shape "person"
    set size 3
    set color blue
  ]
end 

There is only one version of this model, created over 3 years ago by Paul Matthews.

Attached files

File Type Description Last updated
Evolution of Norms.png preview preview over 3 years ago, by Paul Matthews Download

This model does not have any ancestors.

This model does not have any descendants.