Child of AntRecruitmentRebuilt

No preview image

1 collaborator

Emily_warsavage Emily Warsavage (Author)

Tags

(This model has yet to be categorized with any tags)
Child of model AntRecruitmentRebuilt preview imageAntRecruitmentRebuilt
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.0 • Viewed 90 times • Downloaded 7 times • Run 0 times
Download the 'Child of AntRecruitmentRebuilt' 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 model of T. immigrans (pavement ant) recruitment to a food source, beginning with group-recruitment and transitioning to mass-recruitment.

HOW IT WORKS

The foragers randomly explore the world while scenting for food. The first forager to reach the food becomes a leader, returning to the nest and rapidly bringing back a follower ant with it. The follower ants then release high amounts of chemical, which the foragers follow to the food. Each ant that reaches the food reduces the food by some amount, causing the yellow foragers to become orange, and the brown followers to become purple. Followers respond to leader pheromone.

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

The population slider controls the number of ants, while the diffusion-rate and evaporation-rate control the length of time chemical remains in the world. The food-quality slider controls how ants respond to the food, depending on whether it is low quality (below 0.6) or high-quality (above 0.6).

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

How do the ants respond to the white leader vs the purple followers? (suggested things for the user to notice while running the model)

THINGS TO TRY

Try modifying the evaporation-rate and diffusion-rate. Do the ants still respond effectively when chemical evaporates quickly? (suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

Monitor the food level and plot food-level vs time. (suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

Different breeds - types of ants (by default in Netlogo, turtles)

(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

The Ants model by Uri Wilensky and Ant Lines model by Uri Wilensky. (models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

Wilensky, U. (1997). NetLogo Ants model. http://ccl.northwestern.edu/netlogo/models/Ants. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL. Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.

Thanks to Jen B of StackOverflow for help with various aspects of the code, especially the leader breed transformation, and Wade Schuette of the Netlogo Users Group, for help with the reporter for the tick corresponding to the first food reduction. Also thanks to Aaron Brandes, a CCL software developer from the Netlogo Users Group, for help with the reporter for the group-recruitment-initiation reporter. Most of all, thanks to Dr. Michael Greene of UC Denver, who directed this project.

(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

breed [foragers forager]
breed [leaders leader]
breed [followers follower]
breed [gradients gradient]

patches-own
[ nest?
  nest-scent
  nest-x nest-y
  food-source-center-x
  food-source-center-y
  food
  chemical
]

to setup
  clear-all
  set-default-shape turtles "bug"
  create-foragers 10
  [set color yellow
    set size 2.25
    setxy 36 16]
  setup-patches
  reset-ticks
end 

to setup-patches
ask patches
  [setup-nest
  setup-food
  setup-food-quality]
end 

to setup-nest
    ;; set nest? variable to true inside the nest, false elsewhere
  set nest? (distancexy 36 16) < 2
  ;; spread a nest-scent over the whole world -- stronger near the nest
  set nest-scent 200 - distancexy 36 16
  set nest-x 36
  set nest-y 16
  if nest?
  [set pcolor brown]
end 

to setup-food
  if (distancexy (0.8 * min-pxcor) (0.8 * min-pycor)) < 5
  [set food one-of [1 2]
    if food > 0
    [set pcolor cyan]]
  set food-source-center-x -36
  set food-source-center-y -20
end 

to setup-food-quality  ;; patch procedure
  if food > 0
  [set food-quality one-of [0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]] ;; controllable with slider
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  ask foragers
    [wiggle
    fd 1
    look-for-food
    if color = orange + 1
        [uphill-nest-scent
         ifelse distancexy food-source-center-x food-source-center-y < 10
            [hatch-gradients 50
              [set color blue
            set size 3.0]]
            [hatch-gradients 1
              [set color blue
            set size 1.0]]
]
        if nest?
        [set color yellow
              look-for-food]]
ask leaders
      [lead]
ask followers
  [follow-leaders]

  diffuse chemical (diffusion-rate / 100)
  ask patches
  [ set chemical chemical * (100 - evaporation-rate) / 100  ;; slowly evaporate chemical
    recolor-patch ]

  tick
  if sum [food] of patches with [pcolor = cyan] = 0 and ticks > 0
  [stop]
end 

to look-for-food
  let potential-leaders foragers-on (patch-set patch -38 -16 patch -37 -16 patch -36 -16 patch -35 -16 patch -34 -16 patch -39 -17 patch -38 -17 patch -37 -17 patch -36 -17 patch -35 -17 patch -34 -17 patch -33 -17 patch -40 -18 patch -39 -18 patch -38 -18 patch -37 -18 patch -36 -18 patch -35 -18 patch -34 -18 patch -33 -18 patch -32 -18 patch -40 -19 patch -39 -19 patch -38 -19 patch -37 -19 patch -36 -19 patch -35 -19 patch -34 -19 patch -33 -19 patch -32 -19 patch -40 -20 patch -39 -20 patch -38 -20 patch -37 -20 patch -36 -20 patch -35 -20 patch -34 -20 patch -33 -20 patch -32 -20 patch -40 -21 patch -39 -21 patch -38 -21 patch -37 -21 patch -36 -21 patch -35 -21 patch -34 -21 patch -33 -21 patch -32 -21 patch -40 -22 patch -39 -22 patch -38 -22 patch -37 -22 patch -36 -22 patch -35 -22 patch -34 -22 patch -33 -22 patch -32 -22 patch -39 -23 patch -38 -23 patch -37 -23 patch -36 -23 patch -35 -23 patch -34 -23 patch -33 -23 patch -38 -24 patch -37 -24 patch -36 -24 patch -35 -24 patch -34 -24)
  if food > 0 and food-quality > 0
  [ifelse not any? leaders and any? potential-leaders and count foragers <= 10  ;; checks if any leaders exist and if object = true food
  [ ask one-of potential-leaders
    [ set breed leaders
    set color lime]]  ;; transforms first forager to find food into the leader
[set food food - 1
      set color orange + 1]]
end 

to lead
  if color = lime
    [fd 2
      uphill-nest-scent
      if (distancexy nest-x nest-y) <= 2
      [set color white
  if count followers < 8
  [hatch-followers 1
      [set color brown]]
  ]]
  if color = white
      [wiggle
        fd 1
        facexy food-source-center-x food-source-center-y
        if food > 0
        [set color lime]
  ]
  if not can-move? 1 [rt 180]
end 

to group-recruit
  ask leaders
  [if nest? and count followers < 8
    [hatch-followers 1
      [set color brown]
  ]]
end 

to follow-leaders
ask followers
  [face one-of leaders
  fd 1]
end 

to recolor-patch  ;; patch procedure
  ;; give color to nest and food sources
  ifelse nest?                          ;; nest? true --> color brown
  [ set pcolor brown ]
  [ ifelse food > 0                     ;; not nest, but has food
    [  set pcolor cyan ]
    ;; scale color to show chemical concentration
    [ set pcolor scale-color green chemical 0.1 5 ] ]  ;; non-nest, non-food
end 

to wiggle
  rt random 45
  lt random 45
  if not can-move? 1 [ rt 180 ]
end 

to uphill-nest-scent  ;; turtle procedure
  let scent-ahead nest-scent-at-angle   0
  let scent-right nest-scent-at-angle  45
  let scent-left  nest-scent-at-angle -45
  if (scent-right > scent-ahead) or (scent-left > scent-ahead)
  [ ifelse scent-right > scent-left
    [ rt 45 ]
    [ lt 45 ] ]
end 

to-report nest-scent-at-angle [angle]
  let p patch-right-and-ahead angle 1
  if p = nobody [ report 0 ]
  report [nest-scent] of p
end 

There is only one version of this model, created almost 4 years ago by Emily Warsavage.

Attached files

No files

Parent: AntRecruitmentRebuilt

This model does not have any descendants.

Graph of models related to 'Child of AntRecruitmentRebuilt'