Ultimatum Game - survival with offer level equal to level of rejection in agents

No preview image

1 collaborator

Rng_avatar Ronald Paul Ng (Author)

Tags

fairness - sense of fairness and survival 

"if fairness is the reason to offer a certain amount, then that amount should also be fair as the point below which to reject the offerr"

Tagged by Ronald Paul Ng over 4 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0.2 • Viewed 123 times • Downloaded 8 times • Run 0 times
Download the 'Ultimatum Game - survival with offer level equal to level of rejection in agents' modelDownload this modelEmbed this model

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 [ same-cycle
          different-cycle
          same-cycle-rejected
          different-cycle-rejected
          same-cycle-rejected%
          different-cycle-rejected%
          cycle-modifyer
        ]

breed [offer%=rejection%s offer%=rejection%]
breed [offer%!=rejection%s offer%!=rejection%]

turtles-own [ wealth
              offer%
              rejection%
              linked?
            ]

to setup
  ca
  create-offer%=rejection%s 500
      [ setxy random-xcor random-ycor
        set color green
        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% offer%
        set cycle-modifyer 200 ;; allow the model to run 200 cycles, when offer%, rejection% and cycle-rejected% all stabilised.
        set linked? FALSE
      ]
  create-offer%!=rejection%s 500
      [ 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 cycle-modifyer 200 ;; allow the model to run 200 cycles, when offer%, rejection% and cycle-rejected% all stabilised.
        set linked? FALSE
      ]
  set same-cycle 0
  set different-cycle 0
  set same-cycle-rejected 0
  set different-cycle-rejected 0
  set same-cycle-rejected 0
  set different-cycle-rejected% 0
  set different-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. When additional "wealth"is added to the system in the form
  ;; of GDP-PC, it is distributed randomly from 0 to the amount as indicated in the slider minus 1 by the command, random GDP-PC.
  ;; For this reason, the amount deducted from each agent/turtle is GDP-PC / 2.
  ask turtles [ set wealth wealth - (50  * count turtles / carrying-capacity)
                reproduce
              ]
  ask turtles [ if wealth <= 0 [die]]
;  if ticks != 0 and ticks mod cycle-modifyer = 0 [ set cycle-modifyer random 500 + 1  ;; this sets the number of ticks before there will be a change in carrying-capacity
;                                   set carrying-capacity ((random 4 + 1 ) * 1000 )    ;; this sets how much the carrying-capacity is changed randomly in thousands
;                                 ]

;  if ticks > 200 [set carrying-capacity ticks] ;; to see effect of gradually increasing the carrying-capacity instead of having big jumps
  if count offer%=rejection%s = 0 [stop]
  if ticks >= 5000 [stop]
  tick
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
  ifelse breed = offer%!=rejection%s [set different-cycle different-cycle + 1]
                                     [set same-cycle same-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% ]
                                ]
                                 [ifelse breed = offer%!=rejection%s [set different-cycle-rejected different-cycle-rejected + 1]
                                                                        [set same-cycle-rejected same-cycle-rejected + 1]]
  if different-cycle != 0 [set different-cycle-rejected% different-cycle-rejected / different-cycle]
  if same-cycle != 0 [set same-cycle-rejected% same-cycle-rejected / same-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
                       ifelse breed = offer%=rejection%s [ let r  random 1
                                                          ifelse r = 0 [ set offer%  (offer% + random 100) / 2  ;; this sets offer%, followed by rejection%
                                                                         set rejection% offer%]
                                                                       [ set rejection% (rejection% + random 100) / 2 ;; this sets rejection%, followed by offer%
                                                                         set offer% rejection% ]]
                                                        [ set offer% (offer% + random 100) / 2
                                                          set rejection% (rejection% + random 100 ) / 2 ]
                      ]

                       setxy random-xcor random-ycor ] ;; move away from the parent
end 

There is only one version of this model, created over 4 years ago by Ronald Paul Ng.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.