Ultimatum Game - effect of carrying capacity
No preview image
Model was written in NetLogo 6.0.2
•
Viewed 175 times
•
Downloaded 15 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
;; no age ;; children starts with wealth = 50 globals [ cycle cycle-rejected cycle-rejected% ] turtles-own [ wealth offer% rejection% linked? ] to setup ca crt 1000 [ setxy random-xcor random-ycor set color red set wealth 50 ;; start off with 50. Each tick will minus 50 adjusted by carrying capacity. When wealth reaches 0, turtle dies set offer% random 100 set rejection% random 100 set linked? FALSE ] set cycle 0 set cycle-rejected 0 set cycle-rejected% 0 reset-ticks end to go link-turtles ask turtles [if linked? [calculate-wealth]] ;; if the initiator's offer is higher than the receiver's rejection threshold ask turtles [ set linked? false ] clear-links ;; each tick, with each pair of agent/turtle, total amount of 100 units are added to the "world", or average of 50 to each, ;; in order to simulate evolutionary process, where less successful strategies are weeded out by the "death" or removal of thos ;; caarying out those strategy, certain amount of "wealth" has to be removed from each agent/turtle, and since with ;; each round, on average 50 is added to each agent/turtle, the base unit 50 is taken off. This is adjusted by the ratio of ;; population vs the carrying-capacity of the "world" or the society. ask turtles [ set wealth wealth - (50 * count turtles / carrying-capacity) reproduce ] ask turtles [ if wealth <= 0 [die]] tick ; the commands below are meant to test the system when carrying-capacity is altered ; if ticks >= 200 and ticks < 400 [set carrying-capacity 4000] ; if ticks >= 400 and ticks < 600 [set carrying-capacity 1000] ; if ticks >= 600 [stop] end to link-turtles ask turtles [if (not linked?) and any? other turtles with [linked? = false] [ create-link-with one-of other turtles with [linked? != true ] set linked? true ask link-neighbors [set linked? true ] ] ] end to calculate-wealth set cycle cycle + 1 let t-offer% offer% let t-rejection% rejection% let t-wealth wealth let l-offer% 0 let l-rejection% 0 let l-wealth 0 ask link-neighbors [ set l-offer% offer% set l-rejection% rejection% set l-wealth wealth] ;;print l-offer% ;;print [offer%] of link-neighbors ;;print l-rejection% ;;print [rejection%] of link-neighbors ;;print l-wealth ;;print [wealth] of link-neighbors ifelse t-offer% > l-rejection% [ set wealth wealth + ( 100 - offer%) ask link-neighbors [ set wealth wealth + t-offer% ] ] [set cycle-rejected cycle-rejected + 1] set cycle-rejected% cycle-rejected / cycle set linked? false ask link-neighbors [set linked? false] end to reproduce let wealth-factor (wealth / 100 - 1) * 10 ;; verified. At 100 wealth, there is a 50% probability of reproduction. ;; 100 is used because each tick the total amount invoved is 100 let q 1 / (1 + exp (- wealth-factor) ) ;; logistic function for probability of reproduction. Verified let p random-float 1 if p <= q [hatch 1 [ set wealth 50 ;; offspring starts 50, same as all new turtles set offer% (offer% + random 100) / 2 set rejection% (rejection% + random 100) / 2 ; set offer% ([offer%] of myself + random 100) / 2 ;; add an element of randomness ; set rejection% ([rejection%] of myself + random 100) / 2 ;; add an element of randomness setxy random-xcor random-ycor ] ;; move away from the parent ] end
There is only one version of this model, created about 5 years ago by Ronald Paul Ng.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.