Emergence of despotic and egalitarian societies
Model was written in NetLogo 6.1.0
•
Viewed 122 times
•
Downloaded 12 times
•
Run 0 times
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
globals[mean-feq-attacks mean-centrality dominance-differentiation] turtles-own[dominance win list-of-mean-distances current-mean-distance centrality n-attacks] to setup ca ask patches [set pcolor blue] crt n-turtles [set color white setxy (random-xcor / init-cohesion ) (random-ycor / init-cohesion ) set dominance initdom set list-of-mean-distances []] collect-data reset-ticks end to go ask turtles [activation-procedure] ask turtles [set color scale-color red dominance 0 ([dominance] of max-one-of turtles [dominance])] ask turtles [if color > 19.9 [set color yellow]] tick collect-data end to collect-data ask turtles [ set current-mean-distance mean [distance myself] of turtles set list-of-mean-distances fput current-mean-distance list-of-mean-distances set centrality mean list-of-mean-distances ] set mean-centrality mean [centrality] of turtles if not any? turtles with [n-attacks = 0] [ set mean-feq-attacks mean [n-attacks / ticks] of turtles] set dominance-differentiation standard-deviation [dominance] of turtles / mean [dominance] of turtles end to activation-procedure ifelse any? turtles-in perspace [interact][ ifelse any? turtles-in nearview [step 1][ ifelse any? turtles-in maxview [face one-of turtles-in maxview step 1][ set heading heading + (search-angle * ( - 1) ^ (random 2))]]] end to step [d] repeat 10 [fd d / 10] end to-report turtles-in [d] report other turtles in-cone d attentional-angle end to interact let target min-one-of turtles-in perspace [distance myself] let relative-dominance (dominance / (dominance + [dominance] of target)) attack target relative-dominance ifelse win = 1 [ attack target relative-dominance set n-attacks n-attacks + 1 move-after-attack target update-rank target relative-dominance ][ ;loosers-move ] end to attack [tgt rd] let rnd random-float 1 ifelse rd >= rnd [set win 1 ask tgt [set win 0]][set win 0 ask tgt [set win 1]] end to move-after-attack [tgt] ifelse win = 1 [winners-move ask tgt [loosers-move]] [loosers-move ask tgt [winners-move]] end to winners-move step 1 set heading heading + (45 * ( - 1) ^ (random 2)) end to loosers-move set heading (heading + 180 + (45 * ( - 1) ^ (random 2))) step flee-distance end to update-rank [tgt rd] set dominance dominance + stepdom * (win - rd) * ( - 1) ^ (abs (win - 1)) ask tgt [ set dominance dominance + stepdom * ([win] of myself - rd) * ( - 1) ^ (abs (win - 1)) ] ; correct null/negative dominance if dominance <= 0.001 [set dominance 0.001] ask tgt [if dominance <= 0.001 [set dominance 0.001]] end
There is only one version of this model, created about 4 years ago by David Sousa.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Emergence of despotic and egalitarian societies.png | preview | Preview for 'Emergence of despotic and egalitarian societies' | about 4 years ago, by David Sousa | Download |
This model does not have any ancestors.
This model does not have any descendants.