The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Oracle's Java site.
powered by NetLogo
view/download model file: altruism_-_a_gender_perspective.nlogo
The model wants to describe the phenomenon of altruism under a gender perspective, focusing on the behaviour of the agents according to their propensity to donate, which is measured by the percentage of endowment that each agent is willing to give.
Three categories of agents are created in the program: selfsih, selfless, equalitarian. Setting the percentage of male and female and choosing the level of selfishness or selflessness and the price of giving, what is observable in the end is the mean donation of male and female over time.
Notice that the donation amount is influenced by the variable B (the propensity to donate) and by the price of giving. The more the two variables are close to zero, the higher they are, and vice versa.
In the NetLogo Models Library: Altruism
(a reference to the model’s URL on the web if it has one, as well as any other necessary credits, citations, and links)
breed [selfish a-selfish]
breed [selfless a-selfless]
breed [equalitarians equalitarian]
selfish-own [endowment gender B donation] ;; B parameters that represents the fraction of endowment that every agent wants to donate
selfless-own [endowment gender B donation]
equalitarians-own [endowment gender B donation]
globals [priceofgiving donate meandonationM meandonationF]
to setup
ca
reset-ticks
if howmanyagents ="random" [create-selfish random 100]
if howmanyagents ="choose" [create-selfish howmanySelfish]
ask selfish [
set shape "person"
if endowment_agents = "random" [set endowment random 200]
if endowment_agents = "fixed" [set endowment capital_endowment]
set donation 0
set gender "female"
set color pink
set B female_selfishness
setxy random-xcor random-ycor
]
if howmanyagents ="choose"[
ask n-of (howmanySelfish * %_male_selfish) selfish [
set gender "male"
set color blue
set B male_selfishness
]
]
if howmanyagents ="random"[
ask n-of (count selfish * %_male_selfish) selfish [
set gender "male"
set color blue
set B male_selfishness
]
]
if howmanyagents ="random" [ create-selfless random 100]
if howmanyagents ="choose" [ create-selfless howmanySelfless]
ask selfless [
set shape "person"
if endowment_agents = "random" [set endowment random 200]
if endowment_agents = "fixed" [set endowment capital_endowment]
set donation 0
set gender "female"
set color pink
set B female_selflessness
setxy random-xcor random-ycor
]
if howmanyagents ="random"[
ask n-of (count selfless * %_male_selfless) selfless [
set gender "male"
set color blue
set B male_selflessness
]
]
if howmanyagents ="choose"[
ask n-of (howmanySelfless * %_male_selfless) selfless [
set gender "male"
set color blue
set B male_selflessness
]
]
if howmanyagents ="random" [create-equalitarians random 100]
if howmanyagents ="choose" [create-equalitarians howmanyEqualitarians]
ask equalitarians [
set shape "person"
if endowment_agents = "random" [set endowment random 200]
if endowment_agents = "fixed" [set endowment capital_endowment]
set donation 0
set gender "female"
set color pink
set B female_equity
setxy random-xcor random-ycor
]
if howmanyagents ="random"[
ask n-of (count equalitarians * %_male_equalitarians) equalitarians [
set gender "male"
set color blue
set B male_equity
]
]
if howmanyagents ="choose"[
ask n-of (howmanyEqualitarians * %_male_equalitarians) equalitarians [
set gender "male"
set color blue
set B male_equity
]
]
end
to go
set priceofgiving price_of_giving
move
give
prepare_plot_data
end
to move
ask turtles [
set heading random 360
fd random 10
]
end
to give
ask selfish [
if count other turtles-here > 0 and endowment > 0 [
ifelse endowment - B * endowment * priceofgiving > 0 [
set donate B * endowment * priceofgiving
set endowment endowment - donate
set donation donate ]
[set donate endowment
set donation donate
set endowment 0 ]
let an_agent one-of turtles-here
ask an_agent [
set endowment (endowment + donate)]
]
]
ask selfless [
if count other turtles-here > 0 and endowment > 0 [
ifelse endowment - B * endowment * priceofgiving > 0 [
set donate B * endowment * priceofgiving
set endowment endowment - donate
set donation donate ]
[set donate endowment
set donation donate
set endowment 0 ]
let an_agent one-of turtles-here
ask an_agent [
set endowment (endowment + donate)]
]
]
ask equalitarians [
if count other turtles-here > 0 and endowment > 0 [
ifelse endowment - B * endowment * priceofgiving > 0 [
set donate B * endowment * priceofgiving
set endowment endowment - donate
set donation donate ]
[set donate endowment
set donation donate
set endowment 0 ]
let an_agent one-of turtles-here
ask an_agent [
set endowment (endowment + donate)]
]
]
tick
end
to prepare_plot_data
ifelse count turtles with [gender = "male"] > 0 [
set meandonationM mean [donation] of turtles with [gender = "male"]]
[set meandonationM 0]
ifelse count turtles with [gender = "female"] > 0 [
set meandonationF mean [donation] of turtles with [gender = "female"]]
[set meandonationF 0]
end
; Copyright 2011 Angela Gros-Pietro, Gianni Ghetti, Riccardo Addamo. All rights reserved.
; Supervisor: prof.Pietro Terna, Faculty of Economics, University of Turin.