Luca Menardi

Simulation models for economics

Project work on

"Happiness from consumerism or altruism."

 

The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.


An introduction to Happiness from consumerism or altruism application.


powered by NetLogo

view/download model file: happiness_from_consumerism_or_altruism.nlogo

WHAT IS IT?

My model aims to explore the links among level of happiness of people with their own income and income of others.


HOW IT WORKS

The agents are represented by patches, they have an own income that it is used to buy the unique desirable good existing in the world; after the buying the agents make a comparison with others in the world and set their own status of happiness (represented as a dichotomy - happy or unhappy -). Agents when asked to compare can follow one of the two available behaviors:

- consumerist attitude: each agent characterizes himself as happy if he bought a greater amount of the good with respect to others agents in its reference group

- altruistic attitue: each agent characterizes himself as happy if he evaluate that the differences among agents in its reference group are quite small
After that agents work with the result of producing the good and receiving a wage.


HOW TO USE IT

SETUP button: create the world coherently with parameters indicated by user
GO button: start the simulation
increase_own_income_of_100%: when pressed doubles the income of all agents

- %_top: define the percentual of agents in the world that have do be classified as belonging to upper class (% of agents richer), the remaining one are classified as belonging to lower class

- radius_of_looking: fix a boundary to where agents can look to determine their reference group

- altruistic_satisfaction: only in altruistic context it defines the threshold until which the variance of good received makes an agent happy

- global_good_quantity: initial level of good available

- initial_income_reference: fix a sort of reference level for the initial distribution of income (in case of random distribution it is the max level assignable)

- behaviour: define the attitude that agents must follow

- work_behaviour: set the strategy of work that agents must follow

- mantain_stock: determine the policy about the eventually stock of good

- only_look_to_similar: tell agents if in the determination of reference group they have to consider everybody or rather only other agents belonging to their same category

The plots and monitor are self-explanatory.


THINGS TO NOTICE

The final result is not the only important thing, look also at the world during the intermediate step; some particular structures like temporary-aggregation may show up. Moreover if parameters named radius_of_looking or altruistic_satisfaction are greater then the adjustments in the world are faster.


THINGS TO TRY

It is interesting to control for the parameter only_look_to_similar and check the different patterns that arise.

Try also to hit the world with a shock as it is a complete unpredicted doubing of income, it is clearly observable that this has effects only when agents are in an altruistic context.


PROCEDURES

globals [sum_desired
  available_good
  sum_donated
  sum_inequality
  num_top
  ordered_list_income
  price_good]

patches-own [own_income 
  last_wage
  comparison_group
  others_received_mean
  others_received_var
  others_received_stdev
  received
  desired
  donated
  inequality
  category
  production
  happiness]

to setup
  clear-all
  set price_good 10
  ask patches [
    ;set own_income (random-gamma initial_income_reference 10) ;useful for changes on-the-fly
    set own_income (random-float initial_income_reference)
    set happiness one-of ["yes" "no"]]
  evaluate_rank
  assign_color
end

to evaluate_rank
  set num_top (round(count patches * %_top))
  set ordered_list_income reverse(sort([own_income] of patches))
  ;set ordered_list_income sort([own_income] of patches) ;useful for changes on-the-fly
  ask patches [ifelse %_top != 0 [
    ifelse (own_income >= item (num_top - 1) ordered_list_income) [set category "top"]
    [set category "down"]]
  [set category "down"]]
end

to assign_color
  ask patches [
    if (happiness = "yes") and (category = "top") [set pcolor 57]
    if (happiness = "no") and (category = "top") [set pcolor 17]
    if (happiness = "yes") and (category = "down") [set pcolor 55]
    if (happiness = "no") and (category = "down") [set pcolor 15]]
end

to go
  set available_good global_good_quantity
  evaluate_rank
  do_plots_income
  ask patches [set last_wage own_income]
  ask patches [compute_desired]
  set sum_desired (sum [desired] of patches)
  ask patches [receive]
  evaluate_stock
  ask patches [compute_reference]
  if behaviour = "altruistic"[ask patches [donate]
    set sum_donated (sum [donated] of patches)
    set sum_inequality (sum [inequality] of patches)
    ask patches with [donated = 0] [accept_donated]
    ask patches [compare_altruistic]
    ask patches [work]]
  if behaviour = "consumerist"[ask patches [compare_consumerist]
    ask patches [work]]
  set global_good_quantity ((sum [production] of patches) + available_good)
  assign_color
  do_plots_happiness
  ask patches [set others_received_var 0
    set others_received_stdev 0]
  tick
end

to compute_reference 
  if only_look_to_similar = "no" [set comparison_group patches in-radius radius_of_looking]
  if only_look_to_similar = "yes" [set comparison_group patches in-radius radius_of_looking with [category = [category] of myself]]
  set others_received_mean (mean [received] of comparison_group)
  if count comparison_group != 1 [set others_received_var (variance [received] of comparison_group)
    set others_received_stdev (standard-deviation [received] of comparison_group)]
end

to compute_desired
  set desired (own_income / price_good)
end

to receive
  ifelse global_good_quantity >= sum_desired [set received desired]
  [set received (desired * global_good_quantity / sum_desired)]
  set available_good (available_good - received)
  set own_income (own_income - (price_good * received))
end

to evaluate_stock
  if mantain_stock = "no" [set available_good 0] 
end

to compare_altruistic
  compute_reference
  ifelse others_received_var <= altruistic_satisfaction [set happiness "yes"]
  [set happiness "no"]
end


to compare_consumerist
  ifelse received >= others_received_mean [set happiness "yes"]
  [set happiness "no"]
end


to donate
  ifelse received >= others_received_mean [set donated (received - others_received_mean)
    set received (received - donated)]
  [set inequality (others_received_mean - received)]
end

to accept_donated
  ifelse sum_donated >= sum_inequality [set received (received + inequality)]
  [set received (received + (inequality * sum_donated / sum_inequality))]
end


to work
  if work_behaviour = "random" [set own_income (last_wage * random-normal 1 0.15)
    set production ((own_income / price_good) * random-normal 1 0.05)]
  if work_behaviour = "copying_other_people" [set own_income ((others_received_mean * price_good) * random-normal 1 0.0)
    set production ((own_income / price_good) * random-normal 1 0.05)]
end


to do_plots_happiness
  set-current-plot "lower_people"
  set-current-plot-pen "happy"
  plot count patches with [pcolor = green]
  set-current-plot-pen "unhappy"
  plot count patches with [pcolor = red]
  set-current-plot "upper_people"
  set-current-plot-pen "happy"
  plot count patches with [pcolor = 57]
  set-current-plot-pen "unhappy"
  plot count patches with [pcolor = 17]
  set-current-plot "diversity_in_world"
  set-current-plot-pen "upper"
  plot count patches with [category = "top"]
  set-current-plot-pen "lower"
  plot count patches with [category = "down"]
end


to do_plots_income
  set-current-plot "income_average"
  set-current-plot-pen "aver"
  plot mean [own_income] of patches 
  set-current-plot "income_max"
  set-current-plot-pen "max"
  plot first ordered_list_income
  set-current-plot "income_min"
  set-current-plot-pen "min"
  plot last ordered_list_income
  set-current-plot "income_reference"
  set-current-plot-pen "ref"
  if %_top != 0 [plot item (num_top - 1) ordered_list_income]
end