Sugarscape Cultural Dynamics

Sugarscape Cultural Dynamics preview image

1 collaborator

Tags

culture 

Tagged by Diego Díaz Córdova about 2 years ago

sugarscape 

Tagged by Diego Díaz Córdova about 2 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.3.0 • Viewed 593 times • Downloaded 32 times • Run 0 times
Download the 'Sugarscape Cultural Dynamics' 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?

This model in the NetLogo Sugarscape suite implements Epstein & Axtell's Sugarscape Culture dynamics, as described in chapter 3 of their book Growing Artificial Societies: Social Science from the Bottom Up. It simulates a population with limited, spatially-distributed resources available and cultural tags distrbuted among population. Each tag could have a bollean value, 1 or 0. There are 2 differents cultural groups: reds and blues. Each cultural group is defined by the majority rule, more 1s lead to red, more 0s lead to blue. Each individual can pass a cultural tag to another one in their Moore neirghborhood.

HOW IT WORKS

The rules are similar to Sugarscape constant grow, in adition each individual has a list containing cultural tags, that could be 1 or 0. The sum of each tags determines the cultural group, if it is larger than 5 then the cultural group is labeled red, otherwise it is labeled blue. On every tick each turtle encounter other turtles in the Moore neighborhood and if the one who is making the call has a different tag value, then the caller pass this value to the other turtle.

HOW TO USE IT

Set the INITIAL-POPULATION slider before pressing SETUP. This determines the number of agents in the world.

Press SETUP to populate the world with agents and sugar. GO will run the simulation continuously, while GO ONCE will run one tick.

The VISUALIZATION chooser gives different visualization options and may be changed while the GO button is pressed. When NO-VISUALIZATION is selected all the agents will be red. When COLOR-AGENTS-BY-VISION is selected the agents with the longest vision will be darkest and, similarly, when COLOR-AGENTS-BY-METABOLISM is selected the agents with the lowest metabolism will be darkest.

The four plots show the world population over time, the distribution of sugar among the agents, the mean vision of all surviving agents over time, and the mean metabolism of all surviving agents over time.

The two monitors show the amount of turtles belonging to red or blue cultural group.

THINGS TO NOTICE

The world has a carrying capacity, which is lower than the initial population of the world. Agents who are born in sugarless places or who consume more sugar than the land cannot be supported by the world, and die. Other agents die from competition - although some places in the world have enough sugar to support them, the sugar supply is limited and other agents may reach and consume it first.

As the population stabilizes, the average vision increases while the average metabolism decreases. Agents with lower vision cannot find the better sugar patches, while agents with high metabolism cannot support themselves. The death of these agents causes the attribute averages to change.

Despite the red and blue groups are at the begining distributed in a random fashion, when the ticks go on it start to gather by colour in the sugar mountains, at tick 1200 aprox. you can see red turtles in one mountain and the red in the other

THINGS TO TRY

There is some kind of atractor that gather cultural groups in two very differentiated groups. Is there some kind of threshold regarding the amount of turtles at the begining? you can try it changing the initial setup.

EXTENDING THE MODEL

You can change the cultural transmission rule, perhaps thinking, as is stated in Axtell and Epstein's book, in the position of cultural tag (i.e. tags are changed in a bulk fashion)

NETLOGO FEATURES

We use here the matrix extension to build the sugar world.

RELATED MODELS

Other models in the NetLogo Sugarscape suite include:

  • Sugarscape 1 Immediate Growback
  • Sugarscape 3 Wealth Distribution
  • Sugarscape Seasonal Migration

CREDITS AND REFERENCES

Epstein, J. and Axtell, R. (1996). Growing Artificial Societies: Social Science from the Bottom Up. Washington, D.C.: Brookings Institution Press.

HOW TO CITE

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

  • Diaz Cordova, D, (2023). Netlogo Sugarscape 4. Seasonal migration model. Universidad Nacional de Lanús. Argentina.

Please cite the NetLogo software as:

COPYRIGHT AND LICENSE

Copyright 2009 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

Comments and Questions

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

Click to Run Model

extensions [matrix]
turtles-own [
  sugar           ;; the amount of sugar this turtle has
  metabolism      ;; the amount of sugar that each turtles loses each tick
  vision          ;; the distance that this turtle can see in the horizontal and vertical directions
  vision-points   ;; the points that this turtle can see in relative to it's current position (based on vision)
  culture         ;; a list containing cultural tags
  culturecolor    ;; sum of culture list tags
]

patches-own [
  psugar           ;; the amount of sugar on this patch
  max-psugar       ;; the maximum amount of sugar that can be on this patch
]

;;
;; Setup Procedures
;;

to setup
  clear-all
  create-turtles initial-population [ turtle-setup ]
  setup-patches
  reset-ticks
end 

to turtle-setup ;; turtle procedure
  set color red
  set shape "person"
  move-to one-of patches with [not any? other turtles-here]
  set sugar random-in-range 5 25
  set metabolism random-in-range 1 4
  set vision random-in-range 1 6
  ;; turtles can look horizontally and vertically up to vision patches
  ;; but cannot look diagonally at all
  set vision-points []
  foreach (range 1 (vision + 1)) [ n ->
    set vision-points sentence vision-points (list (list 0 n) (list n 0) (list 0 (- n)) (list (- n) 0))
  ]
  set culture n-values 11 [random 2]
  run visualization
end 

to setup-patches
let m matrix:from-row-list [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 2 2 2 2 2 2 2 2]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 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0 0 0 0 0 0]
[1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]
  let i 0
  let j 0
  ;let m1 matrix:transpose m
  ;; let row-i matrix:get-row m i ask patches with [pxcor = i and pycor = j]
  ;[set max-psugar item rowx row-i
  let rowx 49
  repeat 50 [ repeat 50
              [let row-i matrix:get-row m i ask patches with [pxcor = i and pycor = j]
                 [set max-psugar item rowx row-i
                ;ask patches with [pxcor = i and pycor = j] [set max-psugar item rowx (matrix:get-row m i)
                set psugar max-psugar
                patch-recolor
                ]
               set rowx rowx - 1
               set j j + 1
              ]
    set i i + 1
    set j 0
  set rowx 49]
end 
;;
;; Runtime Procedures
;;

to go
  if not any? turtles [
    stop
  ]
  ask patches [
    patch-growback
    patch-recolor
  ]
  ask turtles [
    turtle-culture
    turtle-move
    turtle-eat
    if sugar <= 0
      [ die ]
    run visualization
  ]
  tick
end 

to turtle-culture
  let vecindario turtles-on neighbors4
  ;; me fijo si hay alguna tortuga en su vecindario
  if (count(vecindario) > 0)
    [;; selecciono un tag cultural al azar
     let rndvalue random 11
     let culturetag item rndvalue culture
     ask vecindario [let culturetagV item rndvalue culture
                     if culturetag != culturetagV
                        [set culture replace-item rndvalue culture culturetag]
                    ]
    ]
end 

to turtle-move ;; turtle procedure
  ;; consider moving to unoccupied patches in our vision, as well as staying at the current patch
  let move-candidates (patch-set patch-here (patches at-points vision-points) with [not any? turtles-here])
  let possible-winners move-candidates with-max [psugar]
  if any? possible-winners [
    ;; if there are any such patches move to one of the patches that is closest
    move-to min-one-of possible-winners [distance myself]
  ]
end 

to turtle-eat ;; turtle procedure
  ;; metabolize some sugar, and eat all the sugar on the current patch
  set sugar (sugar - metabolism + psugar)
  set psugar 0
end 

to patch-recolor ;; patch procedure
  ;; color patches based on the amount of sugar they have
  set pcolor (yellow + 4.9 - psugar)
end 

to patch-growback ;; patch procedure
  ;; gradually grow back all of the sugar for the patch
  set psugar min (list max-psugar (psugar + 1))
end 

;;
;; Utilities
;;

to-report random-in-range [low high]
  report low + random (high - low + 1)
end 

;;
;; Visualization Procedures
;;

to no-visualization ;; turtle procedure
  set color red
end 

to color-agents-by-vision ;; turtle procedure
  set color red - (vision - 3.5)
end 

to color-agents-by-metabolism ;; turtle procedure
  set color red + (metabolism - 2.5)
end 

to color-agents-by-culture
  set culturecolor reduce + culture
  ifelse culturecolor > 5
    [set color red]
    [set color blue]
  ;[set color scale-color red culturecolor 0 10 ]
    ;[set color scale-color blue culturecolor 0 10]
end 

; Copyright 2009 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created over 2 years ago by Diego Díaz Córdova.

Attached files

File Type Description Last updated
Sugarscape Cultural Dynamics.png preview Preview for 'Sugarscape Cultural Dynamics' over 2 years ago, by Diego Díaz Córdova Download

This model does not have any ancestors.

This model does not have any descendants.