Socio-Natural Model
Model was written in NetLogo 5.2.0
•
Viewed 290 times
•
Downloaded 20 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Info tab cannot be displayed because of an encoding error
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
globals [ grass gini-index-reserve lorenz-points ] breed [ apersons aperson ] breed [ bpersons bperson ] patches-own [ grass-amount ] turtles-own [ resource ;; the amount of resource this person has age ;; the current age of this person (in ticks) max-age ;; the age at which this person will die of natural causes ] to setup clear-all create-apersons apersons-initial-population [ setup-apersons ] create-bpersons bpersons-initial-population [ setup-bpersons ] ask patches [ set grass-amount random-float 10.0 ;; each patch starts with a random amount of grass recolor-grass ] ;; color it shades of green set grass count patches with [ grass-amount > 0 ] update-lorenz-and-gini reset-ticks end to go if not any? turtles [ stop ] ask turtles [ move harvest if resource >= 5 [ share ] ;; share with a number of neighbors reproduce set age age + 1 if resource < 0 or age > max-age [die] ] regrow-grass set grass count patches with [ grass-amount > 0 ] update-lorenz-and-gini tick end ;;----------------- ;; TURTLE UPDATES ;;----------------- to setup-apersons ;; apersons procedure set color magenta ;; how to color? Shades of a color? set shape "person" set size 1.25;; easier to see setxy random-xcor random-ycor ;;population- what other ways to do this?? where do I want my persons to be? set age 0 set max-age random-float 100 set resource 10 end to setup-bpersons ;; bpersons procedure set color orange set shape "person" set size 1.25;; easier to see setxy random-xcor random-ycor ;;population- what other ways to do this?? where do I want my persons to be? set age 0 set max-age random-float 100 set resource 10 end ;;--------------- ;; GO PROCEDURES ;;--------------- to move ;; how to model migration with vision (high vision for migrators/lower for non?);; make quadrants with different growback rates for seasons? ifelse breed = apersons [ move-apersons ][ if breed = bpersons [ move-bpersons ] ] end to move-apersons let target max-one-of patches [ grass-amount ] face target move-to target set resource resource - 1 end to move-bpersons let target max-one-of neighbors4 [ grass-amount ] face target move-to target set resource resource - 1 end ;;set vision (patches with [ grass-amount > .25 ;; ] in-radius bperson-vision) to harvest ifelse breed = apersons [ harvest-apersons ] [ if breed = bpersons [ harvest-bpersons ] ] end to harvest-apersons ;; eat-cooperative from cooperation model and GL if grass-amount > 5 [ let harvest-amount grass-amount * 0.50 set grass-amount grass-amount - harvest-amount set resource resource + harvest-amount ] recolor-grass end to harvest-bpersons ;; eat-greedy from cooperation model and GL if grass-amount > 0 [ let harvest-amount grass-amount * 1 set grass-amount grass-amount - harvest-amount set resource resource + harvest-amount ] recolor-grass end to share ifelse breed = apersons [ share-apersons ] [ if breed = bpersons [ share-bpersons ] ] end to share-apersons ;;modified from diffusion on a directed network model let recipients apersons in-radius 3 ;; larger radius to suggest more egalitarian, but what if no one from breed in radius? directed link network a better guarantee if any? recipients [ ask recipients [ set resource resource + ( apersons-share-amount / count recipients ) ] ] set resource resource - apersons-share-amount end to share-bpersons ;; modified from diffusion on a directed network model let recipients bpersons in-radius 1 if any? recipients [ ask recipients [ set resource resource + ( bpersons-share-amount / count recipients ) ] ] set resource resource - bpersons-share-amount end to reproduce;;certain age and amount of resource range needed for reproduction; also add sex and neighbor component? ifelse breed = apersons [ reproduce-apersons ] [ if breed = bpersons [ reproduce-bpersons ] ] end to reproduce-apersons ;; must modify reproduction - look at % reproduction in wolf sheep predation model if age >= 15 and age <= 40 ;; and last_reproduced < current_tick - 4 [ hatch random (apersons-number-offspring) [ setup-apersons ] set resource resource / apersons-number-offspring] end to reproduce-bpersons if age >= 15 and age <= 40;; and (last_reproduced < current_tick - 4 [ hatch random (bpersons-number-offspring) [ setup-bpersons ] set resource resource / bpersons-number-offspring] end ;;------------------- ;; PATCH UPDATES ;;------------------- to regrow-grass ask patches [ set grass-amount grass-amount + 0.01 if grass-amount > 10 [ set grass-amount 10 ] recolor-grass ] end to recolor-grass set pcolor scale-color green grass-amount 0 20 end ;;------------------------------------- ;; MONITORING AND REPORTING PROCEDURES ;;------------------------------------- to-report resource-fraction ;; GL, feeding example. the math let possible-resource (count patches) * 10 let total-resource sum [ grass-amount ] of patches report total-resource / possible-resource end to update-lorenz-and-gini let num-people count turtles let sorted-wealths sort [resource] of turtles let total-wealth sum sorted-wealths let wealth-sum-so-far 0 let index 0 set gini-index-reserve 0 set lorenz-points [] repeat num-people [ set wealth-sum-so-far (wealth-sum-so-far + item index sorted-wealths) set lorenz-points lput ((wealth-sum-so-far / total-wealth) * 100) lorenz-points set index (index + 1) set gini-index-reserve gini-index-reserve + (index / num-people) - (wealth-sum-so-far / total-wealth) ] end
There is only one version of this model, created almost 7 years ago by Kailin Hatlestad.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Socio-Natural Model.png | preview | Preview image | almost 7 years ago, by Kailin Hatlestad | Download |
This model does not have any ancestors.
This model does not have any descendants.