Metric_update
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
breed [drugs a-drug] breed [people person] globals [work-bool eat-bool take-drug-bool] people-own [money job-class dopamine-level times-done days-since-drug risk-behavior] to setup ca create-people 20 [ setxy random-xcor random-ycor set shape "person" set size 1.4 let job random 3 set job-class job + 1 ;; 1 = poor, 2 = middle class, 3 = upper class ifelse job-class = 1 [set money random 100] [ ifelse job-class = 2 [set money random 100 + 100 ] [set money random 100 + 200]] set dopamine-level 100 set times-done 0 set risk-behavior random 100 ] create-drugs 20 [setxy random-xcor random-ycor set shape "circle" set size .5] reset-ticks end to go ask people [ let current-enhancer work-change set work-bool True let temp-enhancer eat-change if temp-enhancer > current-enhancer [ set current-enhancer temp-enhancer set work-bool False set eat-bool True ] set temp-enhancer drug-change if temp-enhancer > current-enhancer [ set current-enhancer temp-enhancer set eat-bool False set take-drug-bool True ] ifelse work-bool [ show "current enhancer is work" work] [ ifelse eat-bool [show "current enhancer is eat" eat ] [ show "current enhancer is drugs" do-drugs] ] ] end to walk rt 90 lt 90 fd 1 end to-report work-change ;; less you have, harder you work, more energy it takes let temp-dopamine dopamine-level - (energy-of-job / job-class) let temp-money money + (job-class * energy-of-job) report temp-dopamine + (temp-money / job-class) ;; people who are already rich get less return from working end to-report eat-change let temp-dopamine dopamine-level + energy-from-food let temp-money money - cost-of-food ifelse temp-money > 0 [report temp-dopamine + temp-money] [show "could not afford" report 0] end to-report drug-change let temp-times-done 0 ifelse days-since-drug > 20 [set temp-times-done 1][set temp-times-done times-done + 1] let temp-dopamine dopamine-level + (drug-potency / temp-times-done) let temp-money money - (cost-of-drug * temp-times-done) report temp-dopamine + risk-behavior + temp-money end to work set money money + (job-class * energy-of-job) set dopamine-level dopamine-level - (energy-of-job / job-class) set days-since-drug days-since-drug + 1 end to eat set money money - cost-of-food set dopamine-level dopamine-level + energy-from-food set days-since-drug days-since-drug + 1 end ;; drugs decreases your money and increases your dopamine-level but the amount goes down each time you ;; do it because your tolerance raises so each time you do it the cost also increases bc you have to buy more to do-drugs ifelse days-since-drug > 20 [ set times-done 1 ] [ set times-done times-done + 1 ] set money money - (cost-of-drug * times-done) set dopamine-level dopamine-level + (drug-potency / times-done) set days-since-drug 0 end
There is only one version of this model, created over 9 years ago by Isabella Valdescruz.
Attached files
No files