;; modified by eytan bakshy for version NetLogo 4.0 patches-own [r g b culturalFeatures Mycount player PlayerList Matches OpeningsList ListSize OpeningsIndex FeaturesIndex Trait] to setup ;;clear the model ca ;;set the global clock to 0 reset-ticks ;;issue a set of initialization commands to all patches in the model ask patches [ ;;creates a list object for storing traits set culturalFeatures [] ;;initializes the list while [features > (length culturalFeatures)] [ set culturalFeatures lput random(traits) culturalFeatures ] ;;calls the color method for initial show of model doColor ] display end ;;Main Method of the model to go ;;Issue a set of commands to all patches ask patches [match doColor] ;;increment global clock tick ;;update graphs ; do-plots end ;;Each Patche executes the following procedure to match ;;restset the variables used in this procedure set Mycount 0; set Matches 0; set OpeningsList [] set ListSize -1 set OpeningsIndex -1 set FeaturesIndex -1 set Trait -1 ;;randomly select a neighbor to interact with set player one-of neighbors ;;get the neighbor's list of traits set PlayerList [culturalFeatures] of player ;;compare my traits with my neighbor's traits foreach culturalFeatures [ ifelse (item Mycount PlayerList = ?) [ ;;record count of matches set Matches Matches + 1 ] [ ;; record the index of non-matches set OpeningsList lput Mycount OpeningsList ] ;;keep track of how what index in the list we are at set Mycount Mycount + 1 ] ;;turn the count of matches into a fraction set Matches (Matches / features) ;;interact with probability equal to similarity if ((Matches > random-float 1.0) and (Matches < 1)) [ set ListSize length OpeningsList;; size of index list set OpeningsIndex random(ListSize);; random spot in index list set FeaturesIndex item OpeningsIndex OpeningsList ;; find index to use set Trait item FeaturesIndex PlayerList ;; use index to get Trait ;;copy a randomly selected trait to one of the non-matching traits set culturalFeatures replace-item FeaturesIndex culturalFeatures Trait ] end ;;This uses the values of the traits to determine the coloring of the patches to doColor set MyCount 0 foreach culturalFeatures [ if (MyCount = 0) [set r ? / traits] if (MyCount = 1) [set g ? / traits] if (MyCount = 2) [set b ? / traits] set MyCount MyCount + 1 ] set pcolor (list (255 * r) (255 * g) (255 * b)) ; set pcolor random 12 end ;;Put into Go ;;A global command that selects a single patch to execute ;; if (noise > random(1000)) ;; [ ;; ask random-one-of patches [perturb] ;; ] ;;Randomly replaces a feature to perturb set FeaturesIndex random(features) show culturalFeatures set Trait random(traits) set culturalFeatures replace-item FeaturesIndex culturalFeatures Trait show culturalFeatures end ;to do-plots ; if not plot-groups? [ stop ] ; set-current-plot "Patch Colors" ; set-current-plot-pen "color5" ; plot count patches with [about-color 5 pcolor] ; set-current-plot-pen "color15" ; plot count patches with [about-color 15 pcolor] ; set-current-plot-pen "color25" ; plot count patches with [about-color 25 pcolor] ; set-current-plot-pen "color35" ; plot count patches with [about-color 35 pcolor] ; set-current-plot-pen "color45" ; plot count patches with [about-color 45 pcolor] ; set-current-plot-pen "color55" ; plot count patches with [about-color 55 pcolor] ; set-current-plot-pen "color65" ; plot count patches with [about-color 65 pcolor] ; set-current-plot-pen "color125" ; plot count patches with [about-color 125 pcolor] ; set-current-plot-pen "color85" ; plot count patches with [about-color 85 pcolor] ; set-current-plot-pen "color95" ; plot count patches with [about-color 95 pcolor] ;end @#$#@#$#@ GRAPHICS-WINDOW 235 10 560 356 10 10 15.0 1 10 1 1 1 0 1 1 1 -10 10 -10 10 1 1 1 ticks BUTTON 95 50 163 83 go go T 1 T OBSERVER NIL NIL NIL NIL BUTTON 6 50 78 83 setup setup NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 7 97 99 130 traits traits 2 50 10 1 1 NIL HORIZONTAL PLOT 7 354 572 566 Patch Colors Time Number 0.0 100.0 0.0 200.0 true true PENS "color5" 1.0 0 -7566196 true "color15" 1.0 0 -65536 true "color25" 1.0 0 -44544 true "color35" 1.0 0 -6524078 true "color45" 1.0 0 -256 true "color55" 1.0 0 -11352576 true "color65" 1.0 0 -16711936 true "color125" 1.0 0 -65281 true "color85" 1.0 0 -16711681 true "color95" 1.0 0 -16745473 true SWITCH 9 138 133 171 plot-groups? plot-groups? 1 1 -1000 SLIDER 112 92 215 125 features features 0 100 4 1 1 NIL HORIZONTAL @#$#@#$#@ WHAT IS IT? ----------- If the process of local imitation is a dominant feature of cultural life, why is there so much cultural diversity in the world? This model presents Robert Axelrod's answer to this paradox of cultural diffusion. Each patch engages in a process of local imitation based on homophily (similarity of traits) with its neighbors. While local neighborhoods converge to a set of traits, under some conditions the population diverges - creating multiple cultural groups. HOW IT WORKS ------------ Each round a patch looks at its neighbors. Selecting one neighbor at random, the patch evaluates how many traits it has in common with the neighbor. With probability equal to the similarity between the active patch and its neighbor, the active patch selects a non-matching feature and changes its trait to match its neighbor's. Thus, the more similar that two patches are, the more similar that they become. HOW TO USE IT ------------- The features slider describes the number of different cultural features that each agent has - the number of loci for interaction. The traits slider is the number of values that an agent can have at each locus. The model is initialized so that each feature is randomly set to a value between 1 and traits. THINGS TO TRY ------------- Try to determine what settings drive the model to cultural heterogeneity vs. cultural homogeneity. How do Traits, Features, and system size interact to affect the model? EXTENDING THE MODEL ------------------- Change the decision algorithm to eliminate probabilities of 0 and 1, making the system ergodic. Add external perturbations (noise) to the model. Add repulsion (xenophobia) to the model (so that patches become less like patches that are already dissimilar from them) RELATED MODELS -------------- Genetic Drift CREDITS AND REFERENCES ---------------------- Contributed by Damon Centola based on Robert Axelrod's "Dissemination of Culture", Journal of Conflict Resolution, 1997. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 @#$#@#$#@ NetLogo 4.1.2 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@