Drug Use and overdose
No preview image
Model was written in NetLogo 5.2.0
•
Viewed 254 times
•
Downloaded 21 times
•
Run 0 times
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
extensions [ nw ] globals [ number-overdoses ] ;; set up global variable to keep track of turtles that OD turtles-own [ ;risk ;; turtles have individual levels of suicide risk unemployed? ;; if true you are unemployed: need this variable??? resilience ;; how resilient turtle is to risk variables (protective factor), higher number = more resilient drug-user? ;; if true, then turtle uses drugs drug-level ;; severity of drug use, 0 equals very low ] ;expect network to be fairly stable; expect drug use cluster, non drug use cluster, ;randomly pick up drug use of neighbor at some ticks ;randomly make friends with people with your behavior ;report nw:clustering-coefficient of turtles who OD and those who use drugs to setup ca setup-turtles setup-network ;setup-worksites setup-drugsites reset-ticks end to setup-turtles crt population-size [ set shape "person" set color blue setxy random-xcor random-ycor set drug-user? false set drug-level 0 set unemployed? false ] ask n-of ((percent-drug-user / 100 ) * count turtles) turtles [ set drug-user? true set drug-level random-float .5 if unemployed? [ set drug-level drug-level + .2 ] ;;higher use of drugs if you are unemployed ] end to setup-network ;; num links set by slider??? ask turtles [ ; set up links with turtles wiht whom i'm in the same general area create-links-with n-of (random 4) other turtles in-radius 10 ] end ;to setup-worksites ;; some patches represent the workplace ; ask patch -10 10 [ ; set pcolor yellow ; ask neighbors in-radius 10 [ ; set pcolor yellow ] ; ] ; ask patch 8 -10 [ ; set pcolor yellow ; ask neighbors in-radius 10 [ ; set pcolor yellow ] ; ] ;end to setup-drugsites ;; some of patches turn red to indicate drug availability ask n-of drug-availability patches [ set pcolor red ] end to go ask turtles [ rt 40 lt 10 fd 2 ;go-to-work start-drugs if drug-level > .5 [ ; if turtles have been using drugs enough they can be considered a stable drug user set drug-user? true ] if drug-user? [ ;find-drugs increase-drug-network overdose ] ] tick end ;to go-to-work ;;; make links with turtles who i work with (who are in my neighborhood ; let workplace one-of patches with pcolor yellow ;end ;; pick up drugs in the environment to start-drugs if random 100 < drug-level and (pcolor = red) [ set drug-level drug-level + .1 set drug-user? true ] end ;; make links with turtles who use drugs to increase-drug-network ; let drug-partners turtles with [drug-user?] in-radius 3 ;;if i use drugs- i connect to other nearby drug users and increase my drug use ; if any? drug-partners [ ; create-links-with one-of drug-partners ; set drug-level drug-level + .1 if any? link-neighbors [ ask one-of link-neighbors [ ;; had to take out != myself set drug-level drug-level + .1 ] ; i reinforce/increase other's drug use too ] end ;; OD if drug use too high and too socially isolated ;; OD if drug use too high, period to overdose if (drug-level > .6) and (sum [drug-level] of link-neighbors > 1.2 ) [ set number-overdoses number-overdoses + 1 die ] if drug-level > 2 [ set number-overdoses number-overdoses + 1 die ] end ;randomly pick up drug use of neighbor at some ticks
There is only one version of this model, created over 9 years ago by Gracelyn Cruden.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.