This project aims to analyze the deliveries made by agricultural producers and to determine which ones can be mutualized among producers in order to reduce economic and societal costs.
Data is extracted from the Logicout platform for research purposes only. They are not open for confidentiality reasons but you can contact the SPLOTT laboratory about them.
5 files are expected in the data/raw
folder:
- point_arret.csv : departures and delivery points
- simulation.csv : unique simulations entered in the platform
- trajet.csv : trips between two stops
- usage.csv : metadata on the platform usage (for data quality control)
- utilisateur 0603_Etudiants ENSG_nettoyé.xls: filtered user database for the purpose of this study
To use the API present in the code, you will need:
- A logicout API key
- A Google Maps or Mapbox API key
You will need to put these keys in a .env
file at the root of the repo, formatted as follows :
LOGICOUT_KEY='my_key'
GMAPS_KEY='my_key'
or
LOGICOUT_KEY='my_key'
MAPBOX_KEY='my_key'
The dependencies used for the project are listed on the file environment.yml
.
You can import it as follows :
conda env create -f environment.yml
Run once the file 'prep_data.py' to create two CSVs containing all the data necessary to run the algorithm to find the mutualisations (those files will be stored in the data/raw
folder).
This script will take as input the files .csv from logicout's database and make spatial and attributaires joins between tables to filter the data by entry, user and localization.
This process will create the files data/raw/simulations_gdf.csv
and data/raw/simulations_reel_gdf.csv
For the purpose of this study we will only use the file simulations_reel_gdf.csv
, that contains the selected data of 1097 simulations made in the Logicout application.
Run the script named 'list_mutualisation_index.py' to generate the 'ranked_mutualisations.csv'. 'ranked_mutualisations.csv' list all the indexes for each tour, sorted in ascending order according to the general index.
The script 'mutualisation.py' contains the 'comparison' function that takes two routes and make a request to the Logicout API to compute the costs of an itinerary. The informations are then stored in the file "gains.csv"
The 'main.py' script loop through the file "ranked_simulation.csv" and run the function "comparison" for all the lines of the file 'ranked_mutualisations.csv', having as parameter an itinerary and its better mutualization (the one ranked 0). Note it comes commented by default to avoid an unintended execution, since it will make thousand request for the API and will possibly incur costs in terms of quota.
During the development of the project, we use jupyter notebooks to show preliminary results and discuss technical issues. They are contained in the notebooks directory and are self-explanatory. We keep them to show how some scripts work and and showcase some peculiar points.
This work is licensed under an European Union Public Licence (EUPL) version 1.2.
- Nicolas Roelandt - Univ. Eiffel/AME
- Clovis Bergeret - ENSG
- Gautier Tabordet - ENSG
- Claire Girardin - ENSG
- Thiago Rabacal - ENSG