ABM of Behaviour, Risk and Harassment in Public Transport
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This model explores how different people behave in public transport settings and how these behaviours affect safety. It looks at four types of agents: victims, bystanders, harassers and transport staff. Each agent acts based on factors like fear, confidence, awareness and risk.
The model also includes system-level factors such as awareness campaigns, enforcement, infrastructure quality and social norms. By running the simulation, we can see how individual actions and broader conditions interact to shape patterns of harassment, reporting and trust.
The structure of this model is inspired by the classic NetLogo Segregation model and by ideas from Thomas Schelling about how small individual actions can lead to large social patterns.
HOW TO USE IT
Click SETUP This adds all agents into the environment. Each patch has at most one agent.
Click GO Agents move, interact and make decisions. Harassment events, reporting, intervention and movement all update the system.
Adjust sliders
Crowding controls how many people are present.
Enforcement Level changes how risky harassment feels for offenders.
Awareness Campaign Intensity affects reporting and intervention.
Infrastructure Quality affects the sense of safety.
Social Norms strength influences what people consider acceptable.
Change visualisations You can switch between views that show agent types or views that show emotional states like high fear or high trust.
THINGS TO NOTICE
Harassment appears more often when crowding is high and enforcement is low.
Victims behave differently depending on fear, past experiences and time of day.
Bystanders are more likely to intervene when awareness is high or when others are nearby.
Small changes to social norms can make a big difference to overall safety.
Over time, the model may show areas that feel safer or less safe based on how agents behave.
THINGS TO TRY
- Increase or decrease awareness campaigns. How does this change reporting rates?
- Lower enforcement and see how harassment increases. -Test extreme crowding.
- Change social norms to see how behaviour shifts.
- Run the model several times with the same settings to explore variation.
EXTENDING THE MODEL
- Learning or memory from past incidents
- Specific transport routes like platforms or bus lines
- Agent demographics
- Group harassment behaviour
- Different types of reporting systems
- Social networks that influence decision making
CREDITS AND REFERENCES
Developed for academic purposes, 2025.
Inspired by: Schelling, T. (1978). Micromotives and Macrobehavior. Norton. Wilensky, U. (1997). NetLogo Segregation model. Northwestern University.
NetLogo citation: Wilensky, U. (1999). NetLogo. Northwestern University.
HOW TO CITE
Developed for academic purposes, 2025.
Please cite the NetLogo software as:
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
COPYRIGHT AND LICENSE
Copyright 1997 Uri Wilensky.

This model is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
NetLogo itself is free software for non-commercial use under the terms of the GNU General Public License (see full license information here).
To inquire about commercial licenses for either NetLogo or specific models from the models library, please contact netlogo-commercial-admin@ccl.northwestern.edu.
This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.
This model was converted to from Copyright 1997 Uri Wilensky
Comments and Questions
globals [ percent-similar percent-unhappy total-reports ;; total number of harassment reports total-incidents ;; total number of harassment incidents total-interventions ;; bystander interventions perceived-safety-index ;; average safety level across all non-harasser agents women-harassment-incidents ;; all incidents to women victims men-harassment-incidents ;; all incidents to men victims gender-diverse-harassment-incidents ;; all incidents to gender-diverse victims ] turtles-own [ role fear ;; 0 to 1 trust ;; 0 to 1 awareness ;; 0 to 1 gender ;; only assigned to victims was-harassed? ;; true if this victim has ever been harassed ] to-report harassment-risk-factor ;; U-shaped curve: risk is high near 0 and 1, lowest near 0.5 report (6 * (location-crowdedness - 0.5) ^ 2) end to setup clear-all set total-interventions 0 set total-incidents 0 set total-reports 0 set women-harassment-incidents 0 set men-harassment-incidents 0 set gender-diverse-harassment-incidents 0 create-turtles 200 [ setxy random-xcor random-ycor set role one-of ["victim" "bystander" "harasser" "staff"] ;; Assign role-based colours only set color ifelse-value role = "harasser" [yellow] [ifelse-value role = "bystander" [blue] [ifelse-value role = "victim" [green] [Pink]]] ;; Randomised individual states set fear random-float 1 set trust random-float 1 set awareness random-float 1 ;; default set was-harassed? false ;; Assign gender only to victims if role = "victim" [ set gender one-of ["woman" "man" "gender-diverse"] set shape ifelse-value gender = "woman" ["circle"] [ifelse-value gender = "man" ["square"] ["star"]] ;; for gender-diverse ] ;; Set gender-specific starting fear if gender = "woman" [ set fear 0.7 ] if gender = "gender-diverse" [ set fear 0.6 ] if gender = "man" [ set fear 0.3 ] ] reset-ticks end ; run the model for one tick to go ask turtles [ ;; HARASSER behaviour if role = "harasser" [ ;; Adjust base risk let time-risk ifelse-value (time-of-day >= 20 or time-of-day <= 6) [1.2] [0.8] let gender-risk-multiplier 1.0 ;; Check for nearby victims let nearby-victims other turtles in-radius 2 with [role = "victim"] if any? nearby-victims [ let victim one-of nearby-victims ;; Adjust risk based on victim gender set gender-risk-multiplier ifelse-value [gender] of victim = "woman" [2.0] [ifelse-value [gender] of victim = "gender-diverse" [1.5] [0.9]] let policy-reduction (1 + enforcement-level + infrastructure-quality + awareness-campaign-intensity) let base-risk (harassment-risk-factor * (1 - trust) * time-risk * gender-risk-multiplier / policy-reduction) if random-float 1 < base-risk [ set color red ;; flash on harassment set total-incidents total-incidents + 1 ;; mark this victim as harassed and count incident by gender ask victim [ set was-harassed? true if gender = "woman" [ set women-harassment-incidents women-harassment-incidents + 1 ] if gender = "man" [ set men-harassment-incidents men-harassment-incidents + 1 ] if gender = "gender-diverse" [ set gender-diverse-harassment-incidents gender-diverse-harassment-incidents + 1 ] ] ] ] ;; Reset colour if not harassing if color != red [ set color yellow ] ] ;; BYSTANDER behaviour if role = "bystander" [ let nearby-harassers other turtles in-radius 1 with [role = "harasser"] if any? nearby-harassers [ if random-float 1 < intervention-probability [ set color cyan set trust trust + 0.1 set total-interventions total-interventions + 1 ] ] ] ;; VICTIM behaviour if role = "victim" [ let gender-multiplier ifelse-value gender = "woman" [2.0] [ifelse-value gender = "gender-diverse" [1.5] [0.9]] ;; default for man let nearby-harassers other turtles in-radius 1 with [role = "harasser"] if any? nearby-harassers [ if random-float 1 < (trust * awareness * gender-multiplier) [ set color lime set total-reports total-reports + 1 ] ] ] ;; STAFF behaviour if role = "staff" [ let nearby-agents other turtles in-radius 1 ;; NEW: respond only with some probability if random-float 1 < intervention-probability [ set color violet ;; intervene flash ask nearby-agents [ set trust trust + 0.05 set fear fear - 0.05 ] ] if color != violet [ set color pink ] ;; Optional: continue patrolling right random 360 forward 1 ] ] ;; Awareness update – must be outside the previous block! ask turtles [ set awareness min (list 1 (awareness + awareness-campaign-intensity)) ] ask turtles [ set trust min (list 1 (trust + enforcement-level)) set fear max (list 0 (fear - enforcement-level)) ] ask turtles [ set trust min (list 1 (trust + infrastructure-quality)) set fear max (list 0 (fear - infrastructure-quality)) ] ;;MOVEMENT FOR ALL NON-STAFF AGENTS ask turtles with [role != "staff"] [ rt random 360 fd 1 ] ;; Adjust states based on time of day let night? (time-of-day >= 20 or time-of-day <= 6) ask turtles [ if night? [ set awareness awareness * 0.8 set fear min (list 1 (fear + 0.1)) ] ] tick ;; perceived safety index let relevant-agents turtles with [role != "harasser"] let total-score sum [ (1 - fear + trust + awareness) / 3 ] of relevant-agents set perceived-safety-index total-score / count relevant-agents update-plots end ; See Info tab for full copyright and license.
There is only one version of this model, created about 21 hours ago by Valeria Jimenez Garcia.
Attached files
| File | Type | Description | Last updated | |
|---|---|---|---|---|
| ABM of Behaviour, Risk and Harassment in Public Transport.png | preview | Preview for 'ABM of Behaviour, Risk and Harassment in Public Transport' | about 21 hours ago, by Valeria Jimenez Garcia | Download |
This model does not have any ancestors.
This model does not have any descendants.
Download this model