GiulianoCornacchia / Urban-Impact-Navigators

2 stars 1 forks source link

Navigation Services Amplify Concentration
of Traffic and Emissions in Our Cities

Authors:

Affiliations:
1 Institute of Information Science and Technologies (ISTI), National Research Council (CNR), Pisa, Italy
2 Department of Computer Science, University of Pisa, Pisa, Italy
3 Scuola Normale Superiore, Pisa, Italy


Pre-print available here.


The proliferation of human-AI ecosystems, such as navigation services, raises concerns about their large-scale social and environmental impacts. Our study employs a simulation framework to assess how navigation services influence road network usage and CO2 emissions in urban environments. This repository provides the necessary Python code and tools to reproduce our analysis using the SUMO mobility simulator, offering insights into the collective impact of navigation services at varying adoption rates. To use the code and replicate the analysis, follow the instructions provided in this README file.

Built with

python jupyter numpy pandas osm

Requirements

This project uses the following versions:

Python SUMO

Table of Contents

If you use the code in this repository, please cite our paper:

@misc{cornacchia2024navigation,
      title={Navigation services amplify concentration of traffic and emissions in our cities}, 
      author={Giuliano Cornacchia and Mirco Nanni and Dino Pedreschi and Luca Pappalardo},
      year={2024},
      eprint={2407.20004},
      archivePrefix={arXiv},
      primaryClass={cs.MA},
      url={https://arxiv.org/abs/2407.20004}, 
}

Abstract

The proliferation of human-AI ecosystems involving human interaction with algorithms, such as assistants and recommenders, raises concerns about large-scale social behaviour. Despite evidence of such phenomena across several contexts, the collective impact of GPS navigation services remains unclear: while beneficial to the user, they can also cause chaos if too many vehicles are driven through the same few roads.
Our study employs a simulation framework to assess navigation services' influence on road network usage and CO2 emissions. The results demonstrate a universal pattern of amplified conformity: increasing adoption rates of navigation services cause a reduction of route diversity of mobile travellers and increased concentration of traffic and emissions on fewer roads, thus exacerbating an unequal distribution of negative externalities on selected neighbourhoods. Although navigation services recommendations can help reduce CO2 emissions when their adoption rate is low, these benefits diminish or even disappear when the adoption rate is high and exceeds a certain city- and service-dependent threshold. We summarize these discoveries in a non-linear function that connects the marginal increase of conformity with the marginal reduction in CO2 emissions. Our simulation approach addresses the challenges posed by the complexity of transportation systems and the lack of data and algorithmic transparency.

Code Descriptions

Notebooks

Scripts

Parameters Table for launcher_sumo_simulation.py

Parameter Description Required Default Value
-n, --net-file Path to the SUMO network file Yes None
-r, --route-file Path to the SUMO route file Yes None
-i, --exp-id Experiment identifier Yes None
-o, --output-dir Output directory for results Yes None
--edges-info Collect edge-related measures (1 = yes, 0 = no) No 1
--trips-info Collect trip-related measures (1 = yes, 0 = no) No 1
--log Create a log of the simulation (1 = yes, 0 = no) No 1
--gui Run SUMO with GUI (1 = yes, 0 = no) No 0
--sumo-opt Additional SUMO options No "" (empty)

Example Command:

python launcher_sumo_simulation.py -n network.net.xml -r routes.rou.xml -i exp1 -o ./output --edges-info 1 --trips-info 1 --log 1 --gui 0 --sumo-opt "--time-to-teleport 120"

Parameters Table for launcher_traffico2.py

Parameter Description Required Default Value
-c, --city Name of the city Yes None
-v, --n-vehicles Number of vehicles Yes None
-b, --base Base name Yes None
-n, --navigator Navigator name Yes None
-g, --road-network Path to the road network file Yes None
--path-base Route file for non-routed (base) vehicles Yes None
--path-navigator Route file for routed (navigator) demands Yes None
--path-vehicles-mapping Path for vehicle mapping (routed vs non-routed) Yes None
--list-pct List of adoption rates (e.g., "0-10-20") No "" (0 to 100 in steps of 10)
-o, --output-dir Output folder Yes None
-z, --zipped Zipped option for output files (1 = yes, 0 = no) No 0
--rep-min Minimum repetition No 0
--rep-max Maximum repetition No 9
--njobs Number of parallel jobs No 20

Example Command:

python launcher_traffico2.py -c city_name -v 1000 -b base_name -n navigator_name -g road_network.net.xml --path-base base_route.rou.xml --path-navigator navigator_route.rou.xml --path-vehicles-mapping vehicle_mapping.json --list-pct 0-10-20-30-40-50-60-70-80-90-100 -o ./output_dir --zipped 1 --rep-min 0 --rep-max 9 --njobs 20

Setup

How to install and configure SUMO (Simulation of Urban MObility) 🚗🚙🛻

Install SUMO

Please always refer to the SUMO Installation page for the latest installation instructions.

> Windows

To install SUMO on Windows it is necessary to download the installer here and run the executable.

> Linux

To install SUMO on Linux is it necessary to execute the following commands:

sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-doc

> macOS

SUMO can be installed on macOS via Homebrew.

You can install and update Homebrew as following:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update
brew install --cask xquartz

To install SUMO:

brew tap dlr-ts/sumo
brew install sumo

Configure SUMO

After installing SUMO you must configure your PATH and SUMO_HOME environment variables.

Suppose you installed SUMO at /your/path/to/sumo-<version>

> Windows

  1. On the Windows search box search for "Edit the system environment variables" option and open it;
  2. Under user variables select PATH and click Edit. If no such variable exists you must create it with the New-Button;
  3. Append ;/your/path/to/sumo-<version>/bin to the end of the PATH value (do not delete the existing values);
  4. Under user variables select SUMO_HOME and click Edit. If no such variable exists you must create it with the New-Button;
  5. Set /your/path/to/sumo-<version> as the value of the SUMO_HOME variable.

> Linux

  1. Open a file explorer and go to /home/YOUR_NAME/;
  2. Open the file named .bashrc with a text editor;
  3. Place this code export SUMO_HOME="/your/path/to/sumo-<version>/" somewhere in the file and save;
  4. Reboot your computer.

> macOS

First you need to determine which shell (bash or zsh) you are currently working with. In a terminal, type ps -p $$.

ZSH

In a Terminal, execute the following steps:

  1. Run the command open ~/.zshrc, this will open the .zshrc file in TextEdit;
  2. Add the following line to that document: export SUMO_HOME="/your/path/to/sumo-<version>" and save it;
  3. Apply the changes by entering: source ~/.zshrc.
bash

In a Terminal, execute the following steps:

  1. Run the command open ~/.bash_profile, this will open the .bash_profile file in TextEdit;
  2. Add the following line to that document: export SUMO_HOME="/your/path/to/sumo-<version>" and save it;
  3. Apply the changes by entering: source ~/.bash_profile.

Data Availability

Please note that the OctoTelematics dataset utilized in our study is proprietary and not publicly available. Therefore, the original OD-matrices employed in this research cannot be included in this repository. However, we have provided the necessary code to generate an OD-matrix for Milan using a publicly accessible dataset. This code is flexible and can be adapted for use with any data source. Additionally, we offer a routine to create random OD matrices, which can be useful in scenarios lacking trajectory data.

Furthermore, due to proprietary restrictions, the specific navigation service suggestions used in our study cannot be included. Nonetheless, we have supplied the code to generate a fastest path assignment, replicating the functionality of a navigation service prototype. Moreover, we include a script to generate perturbations of the fastest paths for non-routed vehicles. This ensures that the code can be adapted and applied to various datasets and scenarios, facilitating research on navigation services' impact on urban traffic patterns and CO2 emissions.