Giter Site home page Giter Site logo

xfontes42 / hermes-simulation Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 4.36 MB

HERMES, a tool to ease simulation of road networks with different ATIS systems.

License: MIT License

Python 100.00%
simulation simulation-framework traffic-simulation atis atms

hermes-simulation's Introduction

Hermes: A Tool for Event-driven Meso Simulation of ATIS

Systems Modelling & Simulation: The Sharing of Traffic Knowledge

Usage

usage: main.py [-h] [-n N] [-r R] [-thr THRESH] [-tmax MAX_TIME]
               [-atis ATIS_P] [-p TPEAK_MEAN TPEAK_STD] [-o SAVE_PATH] [-ap]
               [-ar] [-aa] [-v]

Systems Modelling and Simulation

optional arguments:
  -h, --help            show this help message and exit
  -n N, --num_actors N  number of vehicles/actors to generate per simulation
                        run
  -r R, --runs R        number of times to run the simulation for
  -thr THRESH, --congestion_threshold THRESH
                        threshold when to consider a link congested,
                        volume/capacity
  -tmax MAX_TIME, --max_run_time MAX_TIME
                        max time of each simulation run (in hours)
  -atis ATIS_P, --atis_percentage ATIS_P
                        percentage of vehicles using the ATIS system
  -p TPEAK_MEAN TPEAK_STD, --peak TPEAK_MEAN TPEAK_STD
                        mean and standard deviation of a normal distribution
                        that represents a peak in traffic
  -o SAVE_PATH, --out_file SAVE_PATH
                        place to save the result of running the simulations
  -ap, --atis-prevision
                        ATIS will make use of predictions to estimate the
                        fastest route
  -ar, --atis-real      ATIS will make use of real times to estimate the
                        fastest route
  -aa, --atis-adherence
                        ATIS will make use of other atis users' data to
                        estimate the fastest route
  -v, --verbose         allow helpful prints to be displayed
  -pl, --plots          display plots at the end of the simulation regarding
                        the network occupation

S'more details

Advanced traveller information systems (ATIS) have seen a recent surge in popularity among urban users. These systems have the ability to considerably increase traffic flow, across a city's streets but are limited by their penetration ratio among the city's population.

In this work we simulate a road network where different levels of information percolation are tested. The analogy with real life is to assess the extend to which an ATIS can improve total travel time and road utilization, and quantify this usefulness by means of improvements of traffic flow on several metrics.

We out here trying to revolutionize traffic y'all.

Reproducing Paper Experiments

In the paper, three scenarios are analysed: a normal scenario, a accident scenario and a saturated scenario, using the Adherence ATIS. In the matrix below, when can observe the command used to run the correspondent experiment and its results.

Scenario Command Global Actors distribution Actors by Edge distribution Note
Normal Scenario python src/main.py -r 100 -atis 0.3 -aa Normal Global Normal Scenario -
Accident Scenario python src/main.py -r 100 -atis 0.3 -aa Accident Global Accident Scenario Create an AccidentEvent at 10:00 in edge (3, 6) with factor 0.2 in simulator.py, function create_accident_events()
Saturated Scenairo python src/main.py -r 100 -atis 0.3 -aa -n 900 Saturated Global Saturated Scenario -

Additionally, to be able to evaluate the tool performance when varying certain parameters, such as the atis percentage, a tool wrapper was developed in the file plotter.py.

This wrapper can be used as in:

usage: plotter.py [-h] [-i INPUT] [-o OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        File where the run stats will be saved
  -o OUTPUT, --output OUTPUT
                        Output directory for the plots

The obtained graphs when running it are:

Real ATIS Prevision ATIS Adherence ATIS
Varying Atis Percentage Real Atis Prevision Atis Adherence Atis
Varying Total Actors in Simulation Real Atis_nVehicles_cropped Prevision Atis_nVehicles_cropped Adherence Atis_nVehicles_cropped

Dependencies

  • NetworkX: Used for modelling the road network.
  • Numpy: Used for data handling.
  • Pandas: Used for data handling.
  • Seaborn: Used data visualization.
  • Matplotlib: Used for data visualization.

To install the dependencies, one must run the following commands in a terminal containing python3:

  • In Mac/ Linux:
python3  -m venv venv
. venv/bin/activate
pip install -r requirements.txt
python3 generator.py
  • Windows:
py -3 -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
py -3 generator.py

In the end you can deactivate the virtual environment by running:

deactivate

Demo Video here

Contributors

hermes-simulation's People

Contributors

xfontes42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

livingcat

hermes-simulation's Issues

Images

Num Vehicles Plots

Adherence Atis_nVehicles
Prevision Atis_nVehicles
Real Atis_nVehicles


Tais Percentage Plots

Adherence Atis
Prevision Atis
Real Atis

Refactor ao ATIS

  • superclasse ATIS
  • subclasses com métodos comuns (real-time e prevision)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.