Help-Seeking

No preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 62 times • Downloaded 8 times • Run 0 times
Download the 'Help-Seeking' 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

turtles-own [points p-coop info1 info2 info3 info4 edu-attempt]
patches-own [edu-patches]

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

to go
  if (all? turtles [shape = "person graduate"]) [stop] ;; stop after all agents have education
  move-turtles
  get-money
  get-edu
  tick
end 

to move-turtles
  ask turtles [
    right random 360
    forward 1]
end 

to setup-patches ;; creates institution - a purple square in the center; these patches have edu-patches = true
  ask patches [ set pcolor black
  set edu-patches false]
  ask patches with [pxcor > -5 and pxcor < 5 and pycor > -5 and pycor < 5] [set edu-patches true]
  ask patches with [edu-patches] [ set pcolor violet ]
end 

to setup-turtles
  create-turtles n-turtles
  ask turtles [ setxy random-xcor random-ycor
    set color  blue
    set shape "person"
    set size 1.5]
  ask n-of (percent-red * n-turtles) turtles [
  set color red]
    get-info
end 

to get-info ;; sets up knowledge of turtles. You can control how many people get every piece of info via n-get-info
  ask turtles [
    set info1 0
    set info2 0
    set info3 0
    set info4 0]

  ask n-of (p-get-info-blue * count turtles with [color = blue]) turtles with [color = blue] [
    set info1 1]
  ask n-of (p-get-info-blue * count turtles with [color = blue]) turtles with [color = blue] [
    set info2 1]
  ask n-of (p-get-info-blue * count turtles with [color = blue]) turtles with [color = blue] [
    set info3 1]
  ask n-of (p-get-info-blue * count turtles with [color = blue]) turtles with [color = blue] [
    set info4 1]

  ask n-of (p-get-info-red * count turtles with [color = red]) turtles with [color = red] [
    set info1 1]
  ask n-of (p-get-info-red * count turtles with [color = red]) turtles with [color = red] [
    set info2 1]
  ask n-of (p-get-info-red * count turtles with [color = red]) turtles with [color = red] [
    set info3 1]
  ask n-of (p-get-info-red * count turtles with [color = red]) turtles with [color = red] [
    set info4 1]
end 

to get-money ;; turtles play a game where no moves have a cost, but coop brings another person benefit
  ask turtles with [color = red][
    set points points + random get-money-red
    ]
  ask turtles with [color = blue][
    set points points + random get-money-blue
    ]
end 

to get-edu ;; person can attemt to get edu; the more info they have, the higher the chances of getting it on a certain try
  ask patches with [edu-patches] [
    ask turtles-here [
    if points > cost-of-edu and shape = "person" [ ;; person can only attempt edu if they have the "money" and don't have edu yet
    set points points - cost-of-edu ;; they pay for edu
    set edu-attempt edu-attempt + 1 ;; I count attempts to get edu
    if color = blue and random-float 1 < p-seek-help-blue [
      seek-help
      ]
    if color = red and random-float 1 < p-seek-help-red [
      seek-help
      ]
    if info1 + info2 + info3 + info4 = 4[
        set shape "person graduate"
      ]
    if info1 + info2 + info3 + info4 = 3 [
        if random-float 1 < 0.5 [
          set shape "person graduate"
    ]]
    if info1 + info2 + info3 + info4 = 2 [
        if random-float 1 < 0.25 [
          set shape "person graduate"
      ]]
    if info1 + info2 + info3 + info4 = 1 [
        if random-float 1 < 0.125 [
          set shape "person graduate"
      ]]
      if shape = "person" [ ;; if failed to achieve edu, 10% chance to get one of the infos filled (infos are filled in rising order)
        if random-float 1 < p-learn-from-fail [
          ifelse info1 = 0 [
            set info1 1
          ][
            ifelse info2 = 0 [
              set info2 1
            ][
              ifelse info3 = 0 [
                set info3 1
              ][
                set info4 1
    ]]]]]]]]
end 

to seek-help
  ask one-of turtles-on patches with [edu-patches] [
      ifelse info1 > [info1] of myself [
            ask myself [ set info1 1]
          ][
            ifelse info2 > [info2] of myself [
              ask myself [ set info2 1]
            ][
              ifelse info3 > [info3] of myself [
                ask myself [ set info3 1]
              ][
                ask myself [ set info4 1]
      ]]]]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Anastasiia Kuznetsova over 1 year ago Trying to fix framing Download this version
Anastasiia Kuznetsova over 1 year ago Added notes for clarity Download this version
Anastasiia Kuznetsova over 1 year ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.