# -*- coding: utf-8 -*-
from setuptools import setup

package_dir = \
{'': 'src'}

packages = \
['plafosim', 'plafosim.algorithms', 'plafosim.cli']

package_data = \
{'': ['*'], 'plafosim': ['sumocfg/*']}

install_requires = \
['numpy>=1.19,<2.0', 'ortools>=9.0,<9.1', 'pandas>=1.1,<2.0', 'tqdm>=4.61,<5.0']

entry_points = \
{'console_scripts': ['plafosim = plafosim.cli.plafosim:main',
                     'plafosim-img2video = plafosim.cli.img2video:main',
                     'plafosim-replay = plafosim.cli.trace_replay:main']}

setup_kwargs = {
    'name': 'plafosim',
    'version': '0.17.1',
    'description': 'A simple and scalable simulator for platoon formation.',
    'long_description': '# PlaFoSim - A simple and scalable simulator for platoon formation\n[![Code Version](https://img.shields.io/badge/code-v0.17.1-blue)](CHANGELOG.md)\n[![PyPI Version](https://img.shields.io/pypi/v/plafosim)](https://pypi.org/project/plafosim/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/plafosim)](https://pypi.org/project/plafosim/)\n[![License](https://img.shields.io/github/license/heinovski/plafosim?color=green)](LICENSE)\n[![DOI](https://img.shields.io/badge/DOI-10.1109/VNC52810.2021.9644678-blue)](http://dx.doi.org/10.1109/VNC52810.2021.9644678)\n\n[PlaFoSim](https://www.plafosim.de) aims to facilitate and accelerate the research of platoon maneuvers and formation for individually driven vehicles.\nWhile the main focus of the simulator is on the assignment process, simulation of advertisements and maneuvers is implemented in a more abstract way.\n\nA conceptional overview of the process of Platoon Formation that is employed in PlaFoSim [1-2]:\n| Scenario | Advertisement | Assignment | Maneuver |\n| -------- | ------------- | ---------- | -------- |\n| ![Scenario](docs/scenario.png)*A new vehicle enters the highway.* | ![Advertisement](docs/advertisement.png)*The vehicle advertises itself as interested in Platooning.* | ![Assignment](docs/assignment.png)*A Vehicle-to-Platoon assignment is computed.* | ![Maneuver](docs/maneuver.png)*The new vehicle performs a join maneuver.* |\n\nPlaFoSim has been published at [IEEE VNC 2021](https://www.tkn.tu-berlin.de/bib/heinovski2021scalable/):\n\n> Julian Heinovski, Dominik S. Buse and Falko Dressler, "Scalable Simulation of Platoon Formation Maneuvers with PlaFoSim," Proceedings of 13th IEEE Vehicular Networking Conference (VNC 2021), Poster Session, Virtual Conference, November 2021, pp. 137–138.\n\n**NOTE**: PlaFoSim is (still) under heavy development.\n\n---\n\n## Installation\n\n- Install Python (>=3.7,<=3.9)\n- Install PlaFoSim from [pypi](https://pypi.org/project/plafosim/):\n```pip install plafosim```\n\n**NOTE**: The project is developed and currently only tested on Linux.\n\n## Running a Simulation\n\n**NOTE**: Since PlaFoSim is a command-line interface (CLI) application, running PlaFoSim requires using a shell.\n\n### Quickstart\n\nUse PlaFoSim\'s help to get a list of available parameters:\n\n```plafosim -h, --help```\n\nOr, run a simulation with the default configuration (`-d`):\n\n```plafosim -d```\n\n### Live GUI\n\nYou can visualize the simulation via a simple live GUI based on [SUMO](https://github.com/eclipse/sumo/), using the argument `gui` (requires installation of SUMO and decleration of `SUMO_HOME` variable):\n\n```plafosim --gui```\n\n![](docs/gui.png)\n*A screenshot of PlaFoSim\'s live GUI showing 2 platoons and various individual vehicles. Copyright © 2021 IEEE.*\n\nMore options for the live GUI can be found within the ``GUI properties`` section of the help.\n\n**NOTE**: This requires installation of SUMO (>=1.6.0) and declaration of the `SUMO_HOME` variable.\n\n### Advanced Simulation Control\n\nYou can use a variety of different parameters to customize the scenario and the simulation itself.\nE.g., use the parameter `vehicles` to configure the number of vehicles in the simulation:\n\n```plafosim --vehicles 1000```\n\nThe available parameters are grouped into different categories:\n\n```\n- road network properties\n- vehicle properties\n- trip properties\n- communication properties\n- platoon properties\n- formation properties\n- infrastructure properties\n- simulation properties\n- GUI properties\n- result recording properties\n```\n\nYou can find a list of available parameters for each category in the help:\n\n```plafosim -h, --help```\n\n#### Examples\n\n```\n# Configure a 100km freeway with ramps at every 10km\nplafosim --road-length 100 --ramp-interval 10\n\n# Configure random (normally distributed) desired driving speed of 130km/h\nplafosim --random-desired-speed true --desired-speed 36\n\n# Configure random trips for 500 vehicles\nplafosim --vehicles 500 --random-depart-position true --random-arrival-position true --depart-desired true\n\n# Pre fill the freeway with 1000 vehicles\nplafosim --vehicles 1000 --pre-fill true\n\n# Configure 50% of the vehicles with Advanced Cruise Control (ACC) and a headway time of 1.5s\nplafosim --penetration 0.5 --acc-headway-time 1.5\n\n# Enable a simple, distributed platoon formation algorithm [1] in order to form platoons every 30s\nplafosim --formation-algorithm SpeedPosition --formation-strategy distributed --execution-interval 30\n```\n\n### Faster Simulation\n\nYou can speed up the simulation performance by enabling Python\'s optimization ```PYTHONOPTIMIZE```, e.g., in order to disable assertions:\n\n```PYTHONOPTIMIZE=1 plafosim```\n\nSee the Python [documention](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE) for more details.\n\n## Re-Playing a Simulation\n\nThe simulation can write a trace file including the mobility details of every simulated vehicle (default `results_vehicle_traces.csv`).\nYou can replay the simulation in the GUI (see above) based on the trace file by using the corresponding binary:\n\n```plafosim-replay results_vehicle_traces.csv```\n\nTo see all options of this script, run:\n\n```plafosim-replay -h, --help```\n\n## Extending PlaFoSim\n\nIn order to extend PlaFoSim, you first need ot install it from source.\n\n- Install [poetry](https://python-poetry.org/):\n```pip install poetry```\n- Clone this repository:\n```git clone https://github.com/heinovski/plafosim.git```\n- Navigate to newly created directory of the cloned repository in the command-line\n- Install PlaFoSim from source in editable mode:\n```poetry install```\n- Run PlaFoSim in the virtual environment:\n```poetry run plafosim```\nYou can also activate the virtual enviroment first with ```poetry shell``` and run the commands as usual (see above).\n\n### Adding a new Formation Algorithm\n\nIn order to add a new formation algorithm, you need to follow these steps:\n- Create a new sub-class of `FormationAlgorithm` (see `formation_algorithm.py`) within the sub-directory `algorithms`.\nYou can use the `Dummy` algorithm (see `algorithms/dummy.py`) as an example.\n- Add specific arguments for your algorithm to the argument parser group within the new sub-class if necessary.\n\nYou should now be able to use your new algorithm with\n```\nplafosim --formation-algorithm dummy_algorithm_name\n```\n\n## Contributing to the Project\n\nIn order to contribute, please follow these steps:\n- Install PlaFoSim from source (see Extending)\n- Make desired changes and adjust the documentation if required\n- Run the tests located in `tests` as well as the validation scripts located in `scripts` (see `.drone.yml` for details)\n- Submit a Pull Request (PR)\n\n### Documentation\n\nWhen making changes to the doce, make sure to add or adjust corresponding documentation in form of python docstrings.\nThose should use the Numpy docstring format in Sphinx and follow the [style guide](https://numpydoc.readthedocs.io/en/latest/format.html) by numpydoc to ensure consistency and compatibility.\n\n### Testing\n\nWhen adding methods and functions, make sure to add corresponding unit tests for `py.test`.\nThe tests are located under `tests` and can be executed with `./scripts/run-pytest.sh`.\nThis will also generate a test coverage report.\n\n### Validation\n\nTo validate the behavior of PlaFoSim, it is compared to SUMO 1.6.0 by means of simulation results (e.g., vehicle traces).\nThe corresponding scripts are located under `scripts` and executed withn CI/CD pipelines.\nYou can have a look at `.drone.yml` for details regarding the execution.\n\n### Profiling\n\nYou can profile the runtime of PlaFoSim\'s code by using [cProfile](https://docs.python.org/3/library/profile.html#module-cProfile):\n\n```poetry run python -m cProfile -o profile.out -m plafosim.cli.plafosim```\n\nYou can visualize the results of the profiling run by using [SnakeViz](https://jiffyclub.github.io/snakeviz/):\n\n```snakeviz profile.out```\n\n## Contributors & Citing\n\nPlaFoSim was originally designed and built by [Julian Heinovski](https://github.com/heinovski/) with the help of [Dominik S. Buse](https://github.com/dbuse/).\nIt is currently maintained by [Julian Heinovski](https://github.com/heinovski/).\nThe list of all authors can be found [here](AUTHORS.md).\n\nIf you are working with `PlaFoSim`, we would appreciate a citation of [our paper](https://www.tkn.tu-berlin.de/bib/heinovski2021scalable/):\n\n> Julian Heinovski, Dominik S. Buse and Falko Dressler, "Scalable Simulation of Platoon Formation Maneuvers with PlaFoSim," Proceedings of 13th IEEE Vehicular Networking Conference (VNC 2021), Poster Session, Virtual Conference, November 2021, pp. 137–138.\n\n```bibtex\n@inproceedings{heinovski2021scalable,\n    author = {Heinovski, Julian and Buse, Dominik S. and Dressler, Falko},\n    doi = {10.1109/VNC52810.2021.9644678},\n    title = {{Scalable Simulation of Platoon Formation Maneuvers with PlaFoSim}},\n    pages = {137--138},\n    publisher = {IEEE},\n    issn = {2157-9865},\n    isbn = {978-1-66544-450-7},\n    address = {Virtual Conference},\n    booktitle = {13th IEEE Vehicular Networking Conference (VNC 2021), Poster Session},\n    month = {11},\n    year = {2021},\n}\n```\n\n## License\n\nPlaFoSim is licensed under the terms of the GNU General Public License 3.0 or later.\n\n```\n# Copyright (c) 2020-2023 Julian Heinovski <heinovski@ccs-labs.org>\n#\n# SPDX-License-Identifier: GPL-3.0-or-later\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n```\n\n## List of References\n\n[1] Julian Heinovski and Falko Dressler, ["Platoon Formation: Optimized Car to Platoon Assignment Strategies and Protocols,"](https://www.tkn.tu-berlin.de/bib/heinovski2018platoon/) Proceedings of 10th IEEE Vehicular Networking Conference (VNC 2018), Taipei, Taiwan, December 2018.\n\n[2] Julian Heinovski, ["Platoon Formation: Car-to-Platoon Assignments for Individual Cars,"](https://www.tkn.tu-berlin.de/bib/heinovski2019platoon/) Proceedings of International Conference on Networked Systems (NetSys 2019), PhD Forum, Munich, Germany, March 2019.\n',
    'author': 'Julian Heinovski',
    'author_email': 'heinovski@ccs-labs.org',
    'maintainer': 'Julian Heinovski',
    'maintainer_email': 'heinovski@ccs-labs.org',
    'url': 'https://www.plafosim.de',
    'package_dir': package_dir,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.7,<3.10',
}


setup(**setup_kwargs)
