Rumor Model from Qualitative Observations
No preview image
Model was written in NetLogo 6.2.0
•
Viewed 94 times
•
Downloaded 6 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
;; local population is always static ;; volunteers arrive and depart as a function of migrant arrivals and departures ;; agents wander randomly through the world ;; random numbers (user-defined) of the population of migrants and volunteers ;; commit norms violations that the locals don't like. (not liking isn't in code yet) ;; locals witness these violations ;; violations and witnessing are reset at each tick (instances are fleeting) ;; I added an experience variable to count the number of events witnessed, but it's not used right now ;; added networks globals [ ;; Local-Population ;; population is static and defined by user ;; Migrant-Arrival-Rate ;; is a slider that can be adjusted for number of migrants arriving per day (tick) ;; Volunteer-Arrival-Rate ;; is a slider adjusted by user defining a percentage of volunteers based on refugee arrivals ;; Vision ;; controls how far away the locals can see a transgression (measured in patches) ;; Migrant-Weight ;; how much weight a local places on witnessing a migrant transgression to change opinion of them ;; Volunteer-Weight ;; how much weight a local places on witnessing a volunteer transgression to change opinion of them ;; Influence ;; controls how far away locals look to neighbors for a rumor ;; Networks ;; networks on or off Volunteer-incidents ;; infractions by volunteers Migrant-incidents ;; infractsions by migrants ] breed [ migrants migrant ] breed [ volunteers volunteer ] breed [ locals local ] locals-own [ migrant-feelings ;; heterogeneous, normal, (0,1) feelings about refugees volunteer-feelings ;; heterogeneous, normal, (0,1) feelings about volunteers migrant-witness? ;; have witnessed a norm violation by refugee in this tick volunteer-witness? ;; have witnessed a norm violation by volunteer in this tick experience ;; a count of how many events the local has witnessed migrant-rumor-holder? ;; the equivalent of "infected" in SIR model volunteer-rumor-holder? ;; the equivalent of "infected" in SIR model -- like there are two related diseases friends ;; number of friends in network ] turtles-own [ transgressor? ] to setup ca reset-ticks create-locals Local-Population [ set color blue set shape "circle 2" ;; feelings along a normal distribution with mean 0, s.d. 1 set migrant-feelings random-normal 0 1 set volunteer-feelings random-normal 0 1 set migrant-rumor-holder? 0 set volunteer-rumor-holder? 0 set friends 0 setxy random-xcor random-ycor ;; distribute around the environment ] if Networks = True [ ask locals [ set friends random-normal ( Local-Population / 5) ( Local-Population * .05 ) ;; version of normal dist create-links-to up-to-n-of friends other locals set friends count my-links ] ask links [ hide-link ] ] end to go if ticks = 300 [ stop ] reset-violations reset-witness get-over-it outsiders-arrive violate-norm update-global-counters wander witness spread-rumor outsiders-leave tick end to update-global-counters set Volunteer-incidents Volunteer-incidents + count volunteers with [transgressor? = 1 ] set Migrant-incidents Migrant-incidents + count migrants with [ transgressor? = 1 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;; population arrival and departure code ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to outsiders-arrive create-migrants Migrant-Arrival-Rate [ set color red ] ask migrants [ setxy random-xcor random-ycor ] ;; this makes volunteers arrive at a proportion of refugee arrivals let volunteer-draw int (Migrant-Arrival-Rate * (Volunteer-Arrival-Rate / 100) ) create-volunteers volunteer-draw [ set color green set shape "square 2"] ask volunteers [ setxy random-xcor random-ycor ] end to outsiders-leave ask up-to-n-of Migrant-Departure-Rate migrants [ die ] let volunteer-sad int (Migrant-Departure-Rate * (Volunteer-Departure-Rate / 100)) ask up-to-n-of volunteer-sad volunteers [ die ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;; norm violation code ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to violate-norm let integer random Transgression-Rate ask up-to-n-of integer migrants [ set shape "x" set size 2 set color yellow set transgressor? 1 ] ask up-to-n-of (Transgression-Rate - integer) volunteers [ set shape "x" set size 2 set color yellow set transgressor? 1 ] end to reset-violations ask migrants with [transgressor? = 1] [ set shape "default" set size 1 set color red set transgressor? 0 ] ask volunteers with [transgressor? = 1] [ set shape "square 2" set size 1 set color green set transgressor? 0 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;; population movement code ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to wander ask turtles [ left random 180 fd 1 ] end to witness ask locals [ if count migrants with [ transgressor? = 1 ] in-radius Vision >= 1 [ set migrant-witness? 1 set experience experience + 1 set migrant-rumor-holder? 1 update-migrant-feelings if Networks = True [ ask out-link-neighbors [ catch-migrant-rumor ] ] ;; it's not a direct spread, they "catch" it through SIR ] if count volunteers with [ transgressor? = 1 ] in-radius Vision >= 1 [ set volunteer-witness? 1 set experience experience + 1 set volunteer-rumor-holder? 1 update-volunteer-feelings if Networks = True [ ask out-link-neighbors [ catch-volunteer-rumor ] ] ;; it's not a direct spread, they "catch" it through SIR ] ] end to reset-witness ask locals with [migrant-witness? = 1 ] [ set migrant-witness? migrant-witness? = 0 ] ask locals with [volunteer-witness? = 1 ] [ set volunteer-witness? volunteer-witness? = 0 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;; updating locals' feelings code ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;note here that feelings only update in the negative for norm violations ;; adjusts differently for migrants and volunteers to try to capture locals' empathy for certain groups to update-migrant-feelings set migrant-feelings migrant-feelings - 0.1 * Migrant-Weight end to update-volunteer-feelings set volunteer-feelings volunteer-feelings - 0.1 * Volunteer-Weight end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;; SIR/ Rumor Spread code ;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to spread-rumor let susceptibles locals with [ migrant-rumor-holder? = 0 OR volunteer-rumor-holder? = 0 ] ask susceptibles [ if count locals with [ migrant-rumor-holder? = 1 ] in-radius Influence >= 1 [ catch-migrant-rumor ] if count locals with [ volunteer-rumor-holder? = 1 ] in-radius Influence >= 1 [ catch-volunteer-rumor ] ] end to catch-migrant-rumor let coin random 100 ;; select a random number, uniform distribution if coin <= Probability-Spread [ set shape "circle" set migrant-rumor-holder? 1 update-migrant-feelings ] end to catch-volunteer-rumor let coin random 100 ;; select a random number, uniform distribution if coin <= Probability-Spread [ set shape "circle" set volunteer-rumor-holder? 1 update-volunteer-feelings ] end to get-over-it let infected locals with [ migrant-rumor-holder? = 1 OR volunteer-rumor-holder? = 1 ] ask infected [ let coin random 100 ;; select a random number, uniform distribution if coin <= Probability-Recover [ ifelse migrant-rumor-holder? = 1 [ set migrant-rumor-holder? 0 ] [ set volunteer-rumor-holder? 0 ] ;;NOTE THAT THERE IS A PRIORITIZATION HERE AND THAT SOME AGENTS WILL HAVE BOTH TRUE -- NEED TO UPDATE set shape "circle 2" ;;user-message "got better!" ] ] end
There is only one version of this model, created over 2 years ago by Erika Frydenlund.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.