Becker Irrational Behavior

Becker Irrational Behavior preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.2.0 • Viewed 341 times • Downloaded 20 times • Run 0 times
Download the 'Becker Irrational Behavior' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;;#########################################
;;
;; Author: Santiago Gangotena
;; Date Created: 19/2/2016
;;
;;#########################################

globals
[
  price-of-x 
]

;;##############
;;   SET-UP
;;##############

to set-up
  clear-all
  set price-of-x 1
  set-up-patches
  set-up-turtles
  reset-ticks
end 

to set-up-patches
  patches-step
end 

to set-up-turtles
  create-turtles num-of-people
  ask turtles
  [
    set shape "person"
    choose-random-consumption
  ]
end 

;;##############
;;      GO
;;##############

to go-once
  update-price
  patches-step
  turtles-step 
  tick
end 

to go
  update-price
  patches-step
  turtles-step
  tick
end 

to turtles-step
  ask turtles
  [
    choose-random-consumption 
  ]
end 

to patches-step
  ask patches
  [
    update-possibilities-set
  ]
end 

to update-possibilities-set
  ifelse (pycor <= round (income - ( price-of-x * pxcor )))
  [
    set pcolor white 
  ]
  [
    set pcolor black 
  ]
end 

to choose-random-consumption
  let new-patch one-of patches with [ pcolor = white ]
  move-to new-patch 
end 

to update-price
  if (price-of-x < 10 )
  [
    set price-of-x ( price-of-x + (1 / 2))
  ]
end 

There is only one version of this model, created almost 9 years ago by Santiago Gangotena.

Attached files

File Type Description Last updated
Becker Irrational Behavior.png preview Preview for 'Becker Irrational Behavior' almost 9 years ago, by Santiago Gangotena Download

This model does not have any ancestors.

This model does not have any descendants.