breeds[ susceptibles the-law addiction-vectors] ;; defines the breeds
susceptibles-own
[ addiction] ;; the probability that a susceptible will buy drugs
globals
[ nlegality ;; -1 if crack is legal, 1 if crack is illegal
average-addiction ;; tells the average addiction of all the susceptibles
months] ;; tells how many months have passed
to setup
ca ;; clear the screen
setup-constants ;; setups initial constant values
setup-turtles ;; creates turtles (all three types)
update-global-variables ;; setups global variables
end
to setup-constants
ifelse legality = "legal" [set nlegality -1] [set nlegality 1] ;;converts legality to a numerical value
set months 0 ;;set initial month as zero
end
to setup-turtles
cct-susceptibles initial-#-of-susceptibles [set addiction ((random-float 5) + 1)^(-2) set shape "person" set color green] ;; creates susceptibles with random age, addiction & sets their shape to person
cct-the-law (int(sensitivity * 100) + 1) [ set shape "person" set color blue ] ;;creates the-law, sets shape to person
cct-addiction-vectors initial-#-of-addiction-vectors [ set shape "house"] ;;creates addiction-vectors, sets shape to house
ask turtles
[ setxy random-float screen-size-x
random-float screen-size-y] ;;randomly positions turtles
end
to go
move ;;randomly moves susceptibles and the-law
ask susceptibles [encounter] ;;simulates an encounters between the-law and a susceptible
ask susceptibles [buy-drugs] ;;simulates an encounters between an addiction-vector and a susceptible
do-plots ;;plots out the susceptible population and average-addiction
if count susceptibles < 1 [stop] ;;stops simulation if no susceptibles are left
set months months + 1 ;;increments the number of months
if months = 121 [stop] ;;stops simulations after 10 years or 120 months
update-global-variables ;;updates the global variables
end
to move ;;moves the susceptibles and the-law move about at random.
ask susceptibles
[ rt random-float 100 - random-float 100
fd 1 ]
ask the-law
[ rt random-float 100 - random-float 100
fd 1 ]
end
to encounter
if count other-the-law-here > 0 and addiction > 1 - sensitivity ;;simulates an encounters between the-law and a susceptible, the-law takes action if the addiction is greater than 1 - sensitivity
[ifelse nlegality = 1 [die] ;;if crack is illegal the-law kills or arrest susceptibles
[set addiction (addiction * (1 - sensitivity))]] ;;if crack is legal the-law tries to rehabilitate the susceptible
end
to buy-drugs
if count other-addiction-vectors-here > 0
[if addiction < .9 [set addiction (addiction + .1)]] ;;increases the susceptibles addiction by .1 if they buy
end
to do-plots
set-current-plot "addiction"
set-current-plot-pen "average addiction"
plot average-addiction ;;plots the average addiction at this timestep
set-current-plot "Susceptibles"
set-current-plot-pen "Susceptibles"
plot count susceptibles ;;plots the current number of susceptibles
end
to update-global-variables
set average-addiction mean values-from susceptibles[addiction] ;;updates average-addiction
end
@#$#@#$#@
GRAPHICS-WINDOW
470
10
1218
779
20
20
18.0
1
10
1
1
1
CC-WINDOW
735
781
1117
889
Command Center
SLIDER
31
114
225
147
initial-#-of-susceptibles
initial-#-of-susceptibles
1
500
499
1
1
NIL
SLIDER
31
81
225
114
sensitivity
sensitivity
0.0
1
0.59
0.01
1
NIL
BUTTON
53
42
123
77
NIL
setup
NIL
1
T
OBSERVER
T
BUTTON
129
42
200
78
NIL
go
T
1
T
OBSERVER
T
PLOT
22
194
428
489
Addiction
months
addiction
0.0
120.0
0.0
1.0
true
true
PENS
"average addiction" 1.0 0 -16777216 false
MONITOR
167
504
279
553
average addiction
average-addiction
2
1
CHOICE
247
92
385
137
legality
legality
"legal" "illegal"
1
SLIDER
31
147
229
180
initial-#-of-addiction-vectors
initial-#-of-addiction-vectors
0
50
10
1
1
NIL
PLOT
25
560
437
818
Susceptibles
Months
Population
0.0
120.0
0.0
500.0
true
false
PENS
"Susceptibles" 1.0 0 -16711681 true
MONITOR
196
828
305
877
# of susceptibles
count susceptibles
3
1
@#$#@#$#@
An Agent-based Model of Drug Propagation Using Three Populations
by
Bobby Rohrkemper and Josh Savory
WHAT IS IT?
-----------
The primary goal of the Drug Simulation is to model the
propagation of drug addiction through an infected population. The
secondary goal of this model is to determine whether making drugs
illegal or legal is more effective in preventing the spread of
drug addiction.
This model is based on a town with a population of 3,000 to 5,000
people. It observes the town over a short period of time,
approximately 5 to 10 years, and looks at the change in the
average-addiction of the town’s population in this time period.
Since the time frame of the model is so short the model assumes
that the population size doesn't significantly change. This
allows the model to focus purely on the effects of drugs and not
have to simulate the effects of population growth. The town has
the choice to make marijuana legal or illegal depending on which
they feel will best control its spread. Making drugs illegal
determines whether the town will combat the drug problem by
arresting the users or by trying to rehabilitate them. They also
have a sensitivity to the drug problem which determines how
forcefully they will come down on the drug problem.
HOW IT WORKS
------------
In this model we assume their are three different agents who
affect the propagation of drug addiction. These three agents are:
Susceptibles, The-Law and Addiction-Vectors. Susceptibles are the
segment of the population who are susceptible to drug addiction.
The-Law are agents who act to reduce the rate at which addiction
spreads, i.e. cops, doctors, family members..... Addiction-Vectors
are agents meant to simulate the factors that increases drug
addiction i.e. peer pressure, physical addiction, the media...
Each of these agents have rules that define what they should do
when they are alone and when they interact other agents. The
rules determining the agent’s interactions depend on whether
marijuana is legal or illegal and the initial sensitivity of the
population.
The Susceptibles start off with an initial addiction randomly
disturbed over a power function. The purpose of the power function
is to try and simulate a real world situation where you have a few
Susceptibles with high addiction and many Susceptibles with a low
addiction. The initial number of susceptibles is determined by the
user. The Susceptibles addiction physical represents the
probability that they will buy drugs when offered them. They start
off at a random position and from their move about the screen
randomly.
The-Law like the Susceptibles starts off at random positions on
the screen and move about randomly. Their population size is
determined by the sensitivity of the overall population to the
drug problem.
Addiction-Vectors are motionless agents and just wait until they
have the chance to interact with the other agents. The number of
Addiction-Vectors is determined by the user.
When Susceptibles and The-Law encounter each other they will
interact in one of three ways. If the addiction of the
Susceptible is less then 1 minus the sensitivity of the population
The-Law will do nothing. If the addiction of the Susceptible is
greater then 1 minus the sensitivity of the population and
marijuana is illegal the Susceptible will be removed from the
simulation. This is meant to simulate the arrest of the
Susceptible. If the addiction of the Susceptible is greater then
1 minus the sensitivity of the population and marijuana is legal
the Susceptible addiction will be decreased. This is meant to
simulate the rehabilitation of the Susceptible.
When Susceptibles and Addiction-Vectors encounter each other the
addiction of the Susceptible increases.
When The-Law and Addiction-Vectors encounter each nothing happens.
This could be another avenue to investigate in another simulation.
HOW TO USE IT
-------------
To use this model one must first set the Sensitivity of the
population, the initial-number-of-Susceptibles, the
initial-number-of-Addiction-Vectors and the Legality to the
desired values. The Sensitivity describes how forcefully The-Law
will come down on the drug problem. The
initial-number-of-Susceptibles and the
initial-number-of-Addiction-Vectors determine the initial number
of each subset of the population. The Legality determines whether
marijuana is illegal or legal. After these values are set one
then push setup to construct the requested scenario. When the
user is read to start the simulation they must simply click on go.
THINGS TO NOTICE
----------------
Look for optimal values of average-addiction. It is this quantity
which we are trying to minimize.
THINGS TO TRY
-------------
Try legal and illegal scenarios, and explore how this effects the
optimal values. Graph the average-addiction as a function of the
sensitivity as well as the initial number of susceptibles.
EXTENDING THE MODEL
-------------------
There are many features which could be added to make the model
more realistic. We have made a number of assumptions as outlined
in our report.
NETLOGO FEATURES
----------------
We have not made use of any workarounds or special NetLogo code.
RELATED MODELS
--------------
This model is related to another project by Brad Boven, which can
be found at max.cs.kzoo.edu/~bboven/drug_dynamics.pdf. However,
his model was one-dimensional and differential-equation-based,
whereas ours is two-dimensional and agent-based.
CREDITS AND REFERENCES
----------------------
We would like to thank Gabor Csardi for his assistance with this
project. Also, thanks to Dr. Peter Erdi for his instruction in complex
systems theory.
@#$#@#$#@
default
true
0
Polygon -7566196 true true 150 5 40 250 150 205 260 250
house
false
0
Rectangle -65536 true false 89 119 210 224
Polygon -65536 true false 58 119 246 121 150 27
Rectangle -16777216 true false 126 188 146 225
Rectangle -16777216 true false 105 127 131 146
Rectangle -16777216 true false 164 128 194 147
Line -16776961 false 115 144 122 131
Line -16776961 false 117 129 112 129
Line -16776961 false 112 137 125 137
Line -16776961 false 123 142 127 129
Line -16776961 false 175 130 178 137
Line -16776961 false 187 140 188 130
Line -16776961 false 170 137 170 134
Line -16776961 false 179 139 186 137
Line -16776961 false 169 142 177 136
Line -16776961 false 189 144 192 144
person
false
0
Circle -7566196 true true 104 15 94
Rectangle -7566196 true true 107 107 193 231
Line -7566196 true 60 128 242 129
Line -7566196 true 127 230 107 286
Line -7566196 true 170 230 193 284
@#$#@#$#@
NetLogo 2.0.0
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@