MnMS 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mnms-1.1.0/.coveragerc +15 -0
- mnms-1.1.0/.gitignore +46 -0
- mnms-1.1.0/CONTRIBUTING.md +15 -0
- mnms-1.1.0/DEVELOPMENT.md +119 -0
- mnms-1.1.0/LICENSE +165 -0
- mnms-1.1.0/PKG-INFO +141 -0
- mnms-1.1.0/README.md +108 -0
- mnms-1.1.0/pyproject.toml +95 -0
- mnms-1.1.0/pytest.toml +10 -0
- mnms-1.1.0/src/mnms/__init__.py +4 -0
- mnms-1.1.0/src/mnms/cli/__init__.py +0 -0
- mnms-1.1.0/src/mnms/cli/run.py +334 -0
- mnms-1.1.0/src/mnms/demand/__init__.py +6 -0
- mnms-1.1.0/src/mnms/demand/horizon.py +41 -0
- mnms-1.1.0/src/mnms/demand/manager.py +260 -0
- mnms-1.1.0/src/mnms/demand/user.py +904 -0
- mnms-1.1.0/src/mnms/flow/MFD.py +399 -0
- mnms-1.1.0/src/mnms/flow/__init__.py +3 -0
- mnms-1.1.0/src/mnms/flow/abstract.py +139 -0
- mnms-1.1.0/src/mnms/flow/congested_MFD.py +225 -0
- mnms-1.1.0/src/mnms/flow/user_flow.py +383 -0
- mnms-1.1.0/src/mnms/generation/__init__.py +0 -0
- mnms-1.1.0/src/mnms/generation/demand.py +92 -0
- mnms-1.1.0/src/mnms/generation/layers.py +140 -0
- mnms-1.1.0/src/mnms/generation/mlgraph.py +31 -0
- mnms-1.1.0/src/mnms/generation/roads.py +401 -0
- mnms-1.1.0/src/mnms/generation/zones.py +78 -0
- mnms-1.1.0/src/mnms/graph/__init__.py +0 -0
- mnms-1.1.0/src/mnms/graph/dynamic_space_sharing.py +291 -0
- mnms-1.1.0/src/mnms/graph/layers.py +1071 -0
- mnms-1.1.0/src/mnms/graph/road.py +125 -0
- mnms-1.1.0/src/mnms/graph/specific_layers.py +35 -0
- mnms-1.1.0/src/mnms/graph/zone.py +86 -0
- mnms-1.1.0/src/mnms/io/__init__.py +0 -0
- mnms-1.1.0/src/mnms/io/graph.py +165 -0
- mnms-1.1.0/src/mnms/io/utils.py +25 -0
- mnms-1.1.0/src/mnms/log.py +58 -0
- mnms-1.1.0/src/mnms/mobility_service/__init__.py +3 -0
- mnms-1.1.0/src/mnms/mobility_service/abstract.py +836 -0
- mnms-1.1.0/src/mnms/mobility_service/filters.py +464 -0
- mnms-1.1.0/src/mnms/mobility_service/interfaces.py +40 -0
- mnms-1.1.0/src/mnms/mobility_service/on_demand.py +715 -0
- mnms-1.1.0/src/mnms/mobility_service/on_demand_shared.py +738 -0
- mnms-1.1.0/src/mnms/mobility_service/personal_vehicle.py +104 -0
- mnms-1.1.0/src/mnms/mobility_service/public_transport.py +703 -0
- mnms-1.1.0/src/mnms/mobility_service/vehicle_sharing.py +339 -0
- mnms-1.1.0/src/mnms/simulation.py +537 -0
- mnms-1.1.0/src/mnms/time.py +312 -0
- mnms-1.1.0/src/mnms/tools/__init__.py +0 -0
- mnms-1.1.0/src/mnms/tools/cost.py +16 -0
- mnms-1.1.0/src/mnms/tools/dict_tools.py +14 -0
- mnms-1.1.0/src/mnms/tools/exceptions.py +28 -0
- mnms-1.1.0/src/mnms/tools/geometry.py +135 -0
- mnms-1.1.0/src/mnms/tools/observer.py +183 -0
- mnms-1.1.0/src/mnms/tools/preprocessing.py +135 -0
- mnms-1.1.0/src/mnms/tools/progress.py +62 -0
- mnms-1.1.0/src/mnms/tools/render.py +357 -0
- mnms-1.1.0/src/mnms/travel_decision/__init__.py +5 -0
- mnms-1.1.0/src/mnms/travel_decision/abstract.py +967 -0
- mnms-1.1.0/src/mnms/travel_decision/dummy.py +66 -0
- mnms-1.1.0/src/mnms/travel_decision/logit.py +168 -0
- mnms-1.1.0/src/mnms/vehicles/__init__.py +0 -0
- mnms-1.1.0/src/mnms/vehicles/fleet.py +38 -0
- mnms-1.1.0/src/mnms/vehicles/manager.py +62 -0
- mnms-1.1.0/src/mnms/vehicles/veh_type.py +569 -0
- mnms-1.1.0/tests/demand/data_demand/test_bad_optional_column1.csv +3 -0
- mnms-1.1.0/tests/demand/data_demand/test_bad_optional_column2.csv +3 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_bad_departure_format1.csv +2 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_bad_departure_format2.csv +2 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_bad_type1.csv +2 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_bad_type2.csv +2 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_coordinate.csv +5 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_mobility_services.csv +3 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_mobility_services_graph.csv +3 -0
- mnms-1.1.0/tests/demand/data_demand/test_demand_node.csv +5 -0
- mnms-1.1.0/tests/demand/test_csv_demand.py +102 -0
- mnms-1.1.0/tests/flow/test_MFD.py +299 -0
- mnms-1.1.0/tests/flow/test_congested_mfd.py +257 -0
- mnms-1.1.0/tests/flow/test_costs_functions.py +227 -0
- mnms-1.1.0/tests/flow/test_update_graph_MFD.py +182 -0
- mnms-1.1.0/tests/flow/test_user_flow.py +94 -0
- mnms-1.1.0/tests/flow/test_user_walking.py +204 -0
- mnms-1.1.0/tests/flow/test_walk_and_ride.py +332 -0
- mnms-1.1.0/tests/generation/test_generation_demand.py +19 -0
- mnms-1.1.0/tests/graph/test_dynamic_space_sharing.py +516 -0
- mnms-1.1.0/tests/graph/test_layers.py +145 -0
- mnms-1.1.0/tests/graph/test_roads.py +58 -0
- mnms-1.1.0/tests/graph/test_transit_layer.py +119 -0
- mnms-1.1.0/tests/io/test_io_graph.py +74 -0
- mnms-1.1.0/tests/io/test_save_load_transit_link.py +133 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption.py +223 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption_while_waitingPT.py +628 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption_while_waitingRH.py +444 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption_while_waiting_answer_fromRH.py +368 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption_while_walking.py +305 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption_withPT.py +423 -0
- mnms-1.1.0/tests/mobility_services/test_freefloating_interruption_withRH.py +369 -0
- mnms-1.1.0/tests/mobility_services/test_on_demand_depot.py +117 -0
- mnms-1.1.0/tests/mobility_services/test_on_demand_ms.py +410 -0
- mnms-1.1.0/tests/mobility_services/test_on_demand_shared.py +416 -0
- mnms-1.1.0/tests/mobility_services/test_on_demand_waiting_cost.py +401 -0
- mnms-1.1.0/tests/mobility_services/test_personal_car.py +87 -0
- mnms-1.1.0/tests/mobility_services/test_public_transport.py +200 -0
- mnms-1.1.0/tests/mobility_services/test_public_transport_several_pickups.py +110 -0
- mnms-1.1.0/tests/mobility_services/test_station_based_vehicle_sharing.py +142 -0
- mnms-1.1.0/tests/simulation/test_multi_modal.py +107 -0
- mnms-1.1.0/tests/tools/test_render.py +47 -0
- mnms-1.1.0/tests/tools/test_time.py +71 -0
- mnms-1.1.0/tests/travel_decision/data/mobility_services_graph_order1.json +56 -0
- mnms-1.1.0/tests/travel_decision/data/mobility_services_graph_order2.json +56 -0
- mnms-1.1.0/tests/travel_decision/data/test_forced_path.csv +3 -0
- mnms-1.1.0/tests/travel_decision/data/test_wrong_forced_path.csv +3 -0
- mnms-1.1.0/tests/travel_decision/test_availability_personal_vehicle.py +151 -0
- mnms-1.1.0/tests/travel_decision/test_default_behavior.py +207 -0
- mnms-1.1.0/tests/travel_decision/test_default_path_discovery.py +367 -0
- mnms-1.1.0/tests/travel_decision/test_duplicated_ODs.py +208 -0
- mnms-1.1.0/tests/travel_decision/test_forced_path.py +182 -0
- mnms-1.1.0/tests/travel_decision/test_mobility_services_graph.py +210 -0
- mnms-1.1.0/tests/travel_decision/test_save_routes_dynamically_and_reapply.py +219 -0
- mnms-1.1.0/tests/travel_decision/test_several_decision_models.py +386 -0
mnms-1.1.0/.coveragerc
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[html]
|
|
2
|
+
title = MnMS' coverage
|
|
3
|
+
directory = coverage_report
|
|
4
|
+
|
|
5
|
+
[run]
|
|
6
|
+
source = mnms
|
|
7
|
+
|
|
8
|
+
[report]
|
|
9
|
+
show_missing = True
|
|
10
|
+
exclude_lines =
|
|
11
|
+
# Don't complain if tests don't hit defensive assertion code:
|
|
12
|
+
raise AssertionError
|
|
13
|
+
raise NotImplemented
|
|
14
|
+
raise NotImplementedError
|
|
15
|
+
__main__
|
mnms-1.1.0/.gitignore
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Keep the following list of files/directories to exclude from version control as small as possible.
|
|
2
|
+
# Only patterns relevant for the current project should appear in this list.
|
|
3
|
+
|
|
4
|
+
# Python bytecode directories
|
|
5
|
+
__pycache__/
|
|
6
|
+
|
|
7
|
+
# Temporary directories and files created by miscellaneous development tools
|
|
8
|
+
/.cache
|
|
9
|
+
/.coverage
|
|
10
|
+
/.ruff_cache
|
|
11
|
+
/.pytest_cache
|
|
12
|
+
|
|
13
|
+
# FIXME Running the tests result to a log file generated in the root directory.
|
|
14
|
+
# It would be better to isolate these logs in a dedicated directory,
|
|
15
|
+
# and also to avoid that each test overwrites the same log file.
|
|
16
|
+
/log.txt
|
|
17
|
+
|
|
18
|
+
# Directory for test coverage reports
|
|
19
|
+
/coverage_report/
|
|
20
|
+
|
|
21
|
+
# Output directory for Python distribution files (wheels & source distributions)
|
|
22
|
+
/dist/
|
|
23
|
+
|
|
24
|
+
# Ouput directory for documentation generated by MkDocs
|
|
25
|
+
/site/
|
|
26
|
+
|
|
27
|
+
# Python virtual environments (usual names), expected only in the root directory
|
|
28
|
+
/env/
|
|
29
|
+
/venv/
|
|
30
|
+
/.env/
|
|
31
|
+
/.venv/
|
|
32
|
+
/env[_\-]*/
|
|
33
|
+
/venv[_\-]*/
|
|
34
|
+
/.env[_\-]*/
|
|
35
|
+
/.venv[_\-]*/
|
|
36
|
+
|
|
37
|
+
# MacOS files
|
|
38
|
+
.DS_Store
|
|
39
|
+
|
|
40
|
+
# IDE files
|
|
41
|
+
.vscode
|
|
42
|
+
.idea
|
|
43
|
+
.ipynb_checkpoints
|
|
44
|
+
|
|
45
|
+
# Output files generated by the examples
|
|
46
|
+
/examples/*/OUTPUTS
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Contributing to MnMS
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to MnMS!
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Development environment
|
|
7
|
+
|
|
8
|
+
See [DEVELOPMENT.md](DEVELOPMENT.md) for how to set up a development environment
|
|
9
|
+
and run the common development tasks (building, testing, packaging).
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## More to come
|
|
13
|
+
|
|
14
|
+
Guidelines on coding conventions, submitting features and bug fixes, and the
|
|
15
|
+
review process will be added here later.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# MnMS - Developer setup
|
|
2
|
+
|
|
3
|
+
Quick reference for setting up a development environment and running common
|
|
4
|
+
development tasks. For end-user installation, see [README.md](README.md).
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- Python ≥ 3.10
|
|
10
|
+
|
|
11
|
+
Remarks:
|
|
12
|
+
|
|
13
|
+
- The commands below use `pip` with the `--group <group-name>` option, which requires pip ≥ 25.1.
|
|
14
|
+
Upgrade an older pip with:
|
|
15
|
+
```shell
|
|
16
|
+
pip install --upgrade pip
|
|
17
|
+
```
|
|
18
|
+
However, using pip is not mandatory: any package manager that supports
|
|
19
|
+
[dependency-groups](https://packaging.python.org/en/latest/specifications/dependency-groups/)
|
|
20
|
+
([uv](https://docs.astral.sh/uv/), [PDM](https://pdm-project.org/), etc.) can be used instead.
|
|
21
|
+
|
|
22
|
+
- MnMS depends on [HiPOP](https://github.com/EMob-Lab/HiPOP.git), a C++ extension module.
|
|
23
|
+
On the supported OS / system architectures, a prebuilt HiPOP distribution is fetched automatically
|
|
24
|
+
from [PyPI](https://pypi.org/project/HiPOP/), so no C++ toolchain is needed to develop MnMS itself.
|
|
25
|
+
Otherwise, you need to build HiPOP locally: see the
|
|
26
|
+
[HiPOP documentation](https://github.com/EMob-Lab/HiPOP#install-from-local-build).
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Set up the environment
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
git clone https://github.com/EMob-Lab/MnMS.git
|
|
33
|
+
cd MnMS
|
|
34
|
+
pip install --group dev --editable .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The editable install exposes the `src/mnms` package directly, so modifications
|
|
38
|
+
of the Python source files are picked up without reinstalling.
|
|
39
|
+
|
|
40
|
+
Configuration of the build is in `pyproject.toml`.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Common tasks
|
|
44
|
+
|
|
45
|
+
### Set up pre-commit hook
|
|
46
|
+
|
|
47
|
+
A homogeneous style across contributors and editors keeps diffs minimal and free of unrelated noise.
|
|
48
|
+
To that end, [pre-commit](https://pre-commit.com/) checks that files use consistent
|
|
49
|
+
line endings, have no trailing whitespace, and end with a single newline
|
|
50
|
+
(detailed configuration in `.pre-commit-config.yaml`).
|
|
51
|
+
|
|
52
|
+
Run this once in each cloned repository to install the check as a git hook:
|
|
53
|
+
```shell
|
|
54
|
+
pre-commit install
|
|
55
|
+
```
|
|
56
|
+
The hook then runs automatically on `git commit` against the staged files.
|
|
57
|
+
When a staged file breaks one of the rules, the hook rewrites it in place
|
|
58
|
+
and aborts the commit; review the fix, re-stage the file, and commit again.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Run the linter
|
|
62
|
+
|
|
63
|
+
```shell
|
|
64
|
+
ruff check # Report the lint errors
|
|
65
|
+
ruff check --fix # ... or also fix what can be fixed automatically
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The linter [Ruff](https://docs.astral.sh/ruff/) performs a static analysis of the Python code
|
|
69
|
+
to catch likely bugs (unreachable code, misused language constructs, etc.),
|
|
70
|
+
enforce good practices, and check a few code style conventions.
|
|
71
|
+
[Integration with most IDEs is available](https://docs.astral.sh/ruff/editors/setup/).
|
|
72
|
+
|
|
73
|
+
Configuration of the linter is in the `ruff.toml` files
|
|
74
|
+
(repository root, plus incremental overrides in subdirectories where needed).
|
|
75
|
+
|
|
76
|
+
A lint error can be silenced locally on a line with a `# ruff: ignore[<rule-code>]` comment
|
|
77
|
+
(or with [equivalent comments](https://docs.astral.sh/ruff/linter/#error-suppression)
|
|
78
|
+
for block-level or file-level error suppression).
|
|
79
|
+
**Error suppression comments should be a last resort**, reserved for the rare cases where
|
|
80
|
+
the Ruff recommendation cannot reasonably be followed. Each of them must come with
|
|
81
|
+
a short explanation in plain English of why the suppression is needed.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Run the test suite
|
|
85
|
+
|
|
86
|
+
```shell
|
|
87
|
+
pytest
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This command both runs the tests and generates a test coverage report, in directory `coverage_report`.
|
|
91
|
+
|
|
92
|
+
Tests are defined in `tests/`.
|
|
93
|
+
Configuration of the test runner [pytest](https://docs.pytest.org/) is in `pytest.toml`,
|
|
94
|
+
and configuration of coverage analysis plugin [pytest-cov](https://pytest-cov.readthedocs.io/)
|
|
95
|
+
is in `.coveragerc`.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### Build the documentation
|
|
99
|
+
|
|
100
|
+
```shell
|
|
101
|
+
pip install --group doc
|
|
102
|
+
mkdocs serve # Serve the documentation locally with live reload
|
|
103
|
+
mkdocs build # ... or just build the static web pages
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
With `mkdocs build`, the documentation pages are generated in directory `site`.
|
|
107
|
+
Configuration of the documentation tool [mkdocs](https://www.mkdocs.org/) is in `mkdocs.yml`.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Generate distribution files
|
|
111
|
+
|
|
112
|
+
```shell
|
|
113
|
+
pip install --group distrib
|
|
114
|
+
python -m build # Generate a source distribution archive + a wheel
|
|
115
|
+
python -m build --sdist # ... or just the source distribution archive
|
|
116
|
+
python -m build --wheel # ... or just the wheel
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The corresponding artifacts are generated in directory `dist`.
|
mnms-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
mnms-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: MnMS
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Agent-based Multimodal Urban Moblity Simulator resulting from the ERC MAGnUM project
|
|
5
|
+
Project-URL: Repository, https://github.com/EMob-Lab/MnMS
|
|
6
|
+
Project-URL: Issues, https://github.com/EMob-Lab/MnMS/issues
|
|
7
|
+
Maintainer-email: Cécile Becarie <cecile.becarie@univ-eiffel.fr>
|
|
8
|
+
License-Expression: LGPL-3.0-only
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: traffic,urban-mobility
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: dill>=0.4
|
|
24
|
+
Requires-Dist: hipop~=2.0
|
|
25
|
+
Requires-Dist: jsonpickle>=4.1
|
|
26
|
+
Requires-Dist: matplotlib>=3.10
|
|
27
|
+
Requires-Dist: numpy>=2.2
|
|
28
|
+
Requires-Dist: pandas>=2.3
|
|
29
|
+
Requires-Dist: scipy>=1.15
|
|
30
|
+
Requires-Dist: seaborn>=0.13
|
|
31
|
+
Requires-Dist: shapely>=2.1
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# MnMS :candy:
|
|
35
|
+
|
|
36
|
+
MnMS (**M**ultimodal **N**etwork **M**odelling and **S**imulation) is a multimodal dynamic traffic simulator
|
|
37
|
+
designed for a large urban scale. It results from all research activities of the ERC MAGnUM project.
|
|
38
|
+
Further extensions related to on-demand mobility have been developed with the DIT4TraM project.
|
|
39
|
+
|
|
40
|
+
MnMS is an agent-based dynamic simulator for urban mobility. Travelers make mode and route choices considering
|
|
41
|
+
all multimodal options on the city transportation network, including traditional modes,
|
|
42
|
+
such as personal cars or public transportation, and new mobility services, such as ride-hailing,
|
|
43
|
+
ride-sharing, or vehicle sharing.
|
|
44
|
+
Vehicles motion is governed by regional multimodal MFD (Macroscopic Fundamental Diagram) curves,
|
|
45
|
+
so all vehicles of the same type (car, bus, etc.) share the same speed within a specific region at a given time.
|
|
46
|
+
The adoption of this traffic flow modelling framework makes it possible to address at large urban scale
|
|
47
|
+
timely research topics such as the management of new mobility services (operation, optimization, regulation),
|
|
48
|
+
the design of regulatory policies taking into account the multiple stakeholders setting
|
|
49
|
+
of today's urban transportation system, and beyond!
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
### From package manager
|
|
55
|
+
|
|
56
|
+
This is the recommended (and most simple!) method to install MnMS:
|
|
57
|
+
just download it from [PyPI](https://pypi.org/project/MnMS/).
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
pip install mnms
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### From sources
|
|
65
|
+
|
|
66
|
+
1. Download the latest MnMS sources from https://github.com/EMob-Lab/MnMS/archive/refs/heads/main.zip
|
|
67
|
+
or by cloning the git repository:
|
|
68
|
+
```shell
|
|
69
|
+
git clone https://github.com/EMob-Lab/MnMS.git
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
2. From the root directory of the MnMS sources:
|
|
73
|
+
```shell
|
|
74
|
+
pip install .
|
|
75
|
+
|
|
76
|
+
# Optionally, to run the tests:
|
|
77
|
+
pip install --group dev
|
|
78
|
+
pytest
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Remarks: the `--group <group-name>` option requires pip ≥ 25.1. If you have an older version,
|
|
82
|
+
the install command above will fail with an error message such as `no such option: --group`.
|
|
83
|
+
In this case, try to upgrade pip beforehand with:
|
|
84
|
+
```shell
|
|
85
|
+
pip install --upgrade pip
|
|
86
|
+
```
|
|
87
|
+
Alternatively, install the test dependencies `pytest` and `pytest-cov` manually
|
|
88
|
+
(or skip the optional test running step).
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
### HiPOP dependency
|
|
92
|
+
|
|
93
|
+
MnMS depends on [HiPOP](https://github.com/EMob-Lab/HiPOP.git), the C++ graph library
|
|
94
|
+
used under the hood. It is declared as a regular dependency, thus is automatically fetched
|
|
95
|
+
from [PyPI](https://pypi.org/project/HiPOP/) when necessary.
|
|
96
|
+
**For most users this is transparent**: a prebuilt HiPOP distribution adapted
|
|
97
|
+
to your OS / system architecture is downloaded, and no C++ toolchain is required.
|
|
98
|
+
|
|
99
|
+
Prebuilt distributions are currently provided for the following environments:
|
|
100
|
+
- Windows on x86_64 architecture (i.e. Intel/AMD CPU)
|
|
101
|
+
- Linux on x86_64 architecture (i.e. Intel/AMD CPU)
|
|
102
|
+
- MacOS (≥ 14 Sonoma) on ARM64 architecture (i.e. Apple M* CPU)
|
|
103
|
+
|
|
104
|
+
If your environment is not covered, the installation fails while fetching HiPOP.
|
|
105
|
+
You then need to build HiPOP locally (a C++ toolchain is required; see the
|
|
106
|
+
[HiPOP documentation](https://github.com/EMob-Lab/HiPOP#install-from-local-build)),
|
|
107
|
+
or contact the package maintainers.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Usage, tutorials and examples
|
|
111
|
+
|
|
112
|
+
Simulations can be run from the command line with:
|
|
113
|
+
|
|
114
|
+
```shell
|
|
115
|
+
mnms path/to/config.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
... where `path/to/config.json` is a JSON configuration file defining the simulation parameters.
|
|
119
|
+
See `examples/cli/mnms_settings.json` for an example of such a configuration file,
|
|
120
|
+
and run `mnms -h` for more details.
|
|
121
|
+
|
|
122
|
+
Tutorials can be found in the `doc/tutorials` directory as jupyter notebooks.
|
|
123
|
+
Some simulation examples can be found in the `examples` directory.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## Documentation
|
|
127
|
+
|
|
128
|
+
### Built
|
|
129
|
+
|
|
130
|
+
Build the technical documentation using mkdocs with:
|
|
131
|
+
|
|
132
|
+
```shell
|
|
133
|
+
pip install --group doc
|
|
134
|
+
mkdocs serve
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Detailed
|
|
139
|
+
|
|
140
|
+
The detailed documentation is available here:
|
|
141
|
+
https://github.com/EMob-Lab/MnMS/blob/main/doc/MnMS_detailed_documentation.pdf
|
mnms-1.1.0/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# MnMS :candy:
|
|
2
|
+
|
|
3
|
+
MnMS (**M**ultimodal **N**etwork **M**odelling and **S**imulation) is a multimodal dynamic traffic simulator
|
|
4
|
+
designed for a large urban scale. It results from all research activities of the ERC MAGnUM project.
|
|
5
|
+
Further extensions related to on-demand mobility have been developed with the DIT4TraM project.
|
|
6
|
+
|
|
7
|
+
MnMS is an agent-based dynamic simulator for urban mobility. Travelers make mode and route choices considering
|
|
8
|
+
all multimodal options on the city transportation network, including traditional modes,
|
|
9
|
+
such as personal cars or public transportation, and new mobility services, such as ride-hailing,
|
|
10
|
+
ride-sharing, or vehicle sharing.
|
|
11
|
+
Vehicles motion is governed by regional multimodal MFD (Macroscopic Fundamental Diagram) curves,
|
|
12
|
+
so all vehicles of the same type (car, bus, etc.) share the same speed within a specific region at a given time.
|
|
13
|
+
The adoption of this traffic flow modelling framework makes it possible to address at large urban scale
|
|
14
|
+
timely research topics such as the management of new mobility services (operation, optimization, regulation),
|
|
15
|
+
the design of regulatory policies taking into account the multiple stakeholders setting
|
|
16
|
+
of today's urban transportation system, and beyond!
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### From package manager
|
|
22
|
+
|
|
23
|
+
This is the recommended (and most simple!) method to install MnMS:
|
|
24
|
+
just download it from [PyPI](https://pypi.org/project/MnMS/).
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
pip install mnms
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### From sources
|
|
32
|
+
|
|
33
|
+
1. Download the latest MnMS sources from https://github.com/EMob-Lab/MnMS/archive/refs/heads/main.zip
|
|
34
|
+
or by cloning the git repository:
|
|
35
|
+
```shell
|
|
36
|
+
git clone https://github.com/EMob-Lab/MnMS.git
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. From the root directory of the MnMS sources:
|
|
40
|
+
```shell
|
|
41
|
+
pip install .
|
|
42
|
+
|
|
43
|
+
# Optionally, to run the tests:
|
|
44
|
+
pip install --group dev
|
|
45
|
+
pytest
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Remarks: the `--group <group-name>` option requires pip ≥ 25.1. If you have an older version,
|
|
49
|
+
the install command above will fail with an error message such as `no such option: --group`.
|
|
50
|
+
In this case, try to upgrade pip beforehand with:
|
|
51
|
+
```shell
|
|
52
|
+
pip install --upgrade pip
|
|
53
|
+
```
|
|
54
|
+
Alternatively, install the test dependencies `pytest` and `pytest-cov` manually
|
|
55
|
+
(or skip the optional test running step).
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### HiPOP dependency
|
|
59
|
+
|
|
60
|
+
MnMS depends on [HiPOP](https://github.com/EMob-Lab/HiPOP.git), the C++ graph library
|
|
61
|
+
used under the hood. It is declared as a regular dependency, thus is automatically fetched
|
|
62
|
+
from [PyPI](https://pypi.org/project/HiPOP/) when necessary.
|
|
63
|
+
**For most users this is transparent**: a prebuilt HiPOP distribution adapted
|
|
64
|
+
to your OS / system architecture is downloaded, and no C++ toolchain is required.
|
|
65
|
+
|
|
66
|
+
Prebuilt distributions are currently provided for the following environments:
|
|
67
|
+
- Windows on x86_64 architecture (i.e. Intel/AMD CPU)
|
|
68
|
+
- Linux on x86_64 architecture (i.e. Intel/AMD CPU)
|
|
69
|
+
- MacOS (≥ 14 Sonoma) on ARM64 architecture (i.e. Apple M* CPU)
|
|
70
|
+
|
|
71
|
+
If your environment is not covered, the installation fails while fetching HiPOP.
|
|
72
|
+
You then need to build HiPOP locally (a C++ toolchain is required; see the
|
|
73
|
+
[HiPOP documentation](https://github.com/EMob-Lab/HiPOP#install-from-local-build)),
|
|
74
|
+
or contact the package maintainers.
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Usage, tutorials and examples
|
|
78
|
+
|
|
79
|
+
Simulations can be run from the command line with:
|
|
80
|
+
|
|
81
|
+
```shell
|
|
82
|
+
mnms path/to/config.json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
... where `path/to/config.json` is a JSON configuration file defining the simulation parameters.
|
|
86
|
+
See `examples/cli/mnms_settings.json` for an example of such a configuration file,
|
|
87
|
+
and run `mnms -h` for more details.
|
|
88
|
+
|
|
89
|
+
Tutorials can be found in the `doc/tutorials` directory as jupyter notebooks.
|
|
90
|
+
Some simulation examples can be found in the `examples` directory.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## Documentation
|
|
94
|
+
|
|
95
|
+
### Built
|
|
96
|
+
|
|
97
|
+
Build the technical documentation using mkdocs with:
|
|
98
|
+
|
|
99
|
+
```shell
|
|
100
|
+
pip install --group doc
|
|
101
|
+
mkdocs serve
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Detailed
|
|
106
|
+
|
|
107
|
+
The detailed documentation is available here:
|
|
108
|
+
https://github.com/EMob-Lab/MnMS/blob/main/doc/MnMS_detailed_documentation.pdf
|