Simple Shibboleth

Simple Shibboleth preview image

1 collaborator

Tags

cultural evolution 

Tagged by Jonathan R Goodman over 4 years ago

language 

Tagged by Jonathan R Goodman over 4 years ago

social evolution 

Tagged by Jonathan R Goodman over 4 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 189 times • Downloaded 9 times • Run 0 times
Download the 'Simple Shibboleth' modelDownload this modelEmbed this model

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


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

turtles-own [fitness mimicry]

breed [bluebeards bluebeard]
breed [greenbeards greenbeard]
breed [guardians guardian]

to setup
  clear-all
  setup-patches
  setup-turtles
  reset-ticks
end 

to setup-patches
  ask patches with [
    pycor >= -16 and
    pycor <= -1 and
    pxcor >= -16 and
    pxcor <= 16  ]
    [ set pcolor 44 ]
  ask patches with [
    pycor <= 16 and
    pycor >= 2 and
    pxcor >= -16 and
    pxcor <= 16 ]
    [ set pcolor 33 ]
  ask patches with [
    pycor >= 0 and
    pycor <= 1 ]
  [ set pcolor blue ]
  ask patches at-points [[0 0] [0 1] [-1 0] [-1 1] [1 0] [1 1]]
  [set pcolor brown ]
end 

to setup-turtles
  set-default-shape turtles "person"
  create-bluebeards 50 [
    move-to one-of patches with [ pcolor = 44 ]
  set color 104
  set mimicry random (mimicry-modifier) + 1
  set fitness (random (100 - mimicry-modifier)) + mimicry
  ]
  create-greenbeards 50 [
    move-to one-of patches with [ pcolor = 33 ]
  set color green
  set fitness random 100 + 1
  ]
  create-guardians 1 [
    move-to patch 0 0
    set color red
  ]
end 

to go
  if count bluebeards-on patches with [ pcolor = 44 ] = 0 and
  count bluebeards-on patches with [ pcolor = brown ] = 0 and
  count bluebeards-on patches with [ pcolor = blue ] = 0
  [ stop ]
 move-bluebeards
 move-greenbeards
 detect-mimics
tick
end 

to move-bluebeards
  ask bluebeards [
    seek-safety
    avoid-water
    check-death
    blend-in
    forward 1
    ifelse show-fitness?
    [ set label fitness ]
    [ set label round ((mimicry / mimicry-modifier) * 100) ]
  ]
end 

to move-greenbeards
  ask greenbeards [
  facexy random-xcor random-ycor
  forward 1
  facexy random-xcor 16
  forward 1.1
    ]
end 

to avoid-water
  if [pcolor] of patch-here = blue or [pcolor] of patch-here = 44 [
  let target-patch patch-right-and-ahead 0 1
  if target-patch != nobody and [pcolor] of target-patch = blue [
    move-to patch 0 -7
  ]
]
end 

to seek-safety
  if [pcolor] of patch-here = 44 [
    let safety-patch patch 10 10
    if safety-patch != nobody and [pcolor] of safety-patch = 33 [
      facexy random-pxcor 16
    ]
    ]
end 

to check-death
  if fitness <= 0 [ die ]
end 

to blend-in
  if [pcolor] of patch-here = 33 [
facexy random-xcor random-ycor
  forward 1
  facexy random-xcor 12
  forward 1.1
    ]
end 

to detect-mimics
  ask guardians [
     if count turtles-at 1 0 != nobody [
      ask bluebeards-at 1 0 [
      if ((mimicry / mimicry-modifier) * 100) < detection-risk [
        set fitness fitness - cost ]
      if ((mimicry / mimicry-modifier) * 100) = detection-risk [
       if random 2 = 0 [
            set fitness fitness - cost ]
        ]
  ]
    ]
     if count turtles-at 0 0 != nobody [
      ask bluebeards-at 0 0  [
      if ((mimicry / mimicry-modifier) * 100) < detection-risk [
        set fitness fitness - cost ]
      if ((mimicry / mimicry-modifier) * 100) = detection-risk [
       if random 2 = 0 [
            set fitness fitness - cost ]
        ]
  ]
    ]
     if count turtles-at -1 0 != nobody [
      ask bluebeards-at -1 0  [
      if ((mimicry / mimicry-modifier) * 100) < detection-risk [
        set fitness fitness - cost ]
      if ((mimicry / mimicry-modifier) * 100) = detection-risk [
       if random 2 = 0 [
            set fitness fitness - cost ]
        ]
  ]
    ]
  ]
end 

There is only one version of this model, created over 4 years ago by Jonathan R Goodman.

Attached files

File Type Description Last updated
Simple Shibboleth.png preview Preview for 'Simple Shibboleth' over 4 years ago, by Jonathan R Goodman Download

This model does not have any ancestors.

This model does not have any descendants.