iscpp-simulator 0.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.
Files changed (98) hide show
  1. iscpp_simulator-0.1.0/CITATION.cff +10 -0
  2. iscpp_simulator-0.1.0/LICENSE +21 -0
  3. iscpp_simulator-0.1.0/MANIFEST.in +7 -0
  4. iscpp_simulator-0.1.0/PKG-INFO +394 -0
  5. iscpp_simulator-0.1.0/README.md +369 -0
  6. iscpp_simulator-0.1.0/pyproject.toml +57 -0
  7. iscpp_simulator-0.1.0/setup.cfg +4 -0
  8. iscpp_simulator-0.1.0/src/iscpp_simulator/__init__.py +3 -0
  9. iscpp_simulator-0.1.0/src/iscpp_simulator/__main__.py +5 -0
  10. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/Berlin_1_256.map +260 -0
  11. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/Boston_0_256.map +260 -0
  12. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/Paris_1_256.map +260 -0
  13. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/brc202d.map +485 -0
  14. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/den312d.map +85 -0
  15. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/den520d.map +261 -0
  16. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/empty-16-16.map +20 -0
  17. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/empty-32-32.map +36 -0
  18. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/empty-48-48.map +52 -0
  19. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/empty-8-8.map +12 -0
  20. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/ht_chantry.map +145 -0
  21. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/ht_mansion_n.map +274 -0
  22. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/lak303d.map +198 -0
  23. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/lt_gallowstemplar_n.map +184 -0
  24. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/Berlin_1_256.map +260 -0
  25. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/Boston_0_256.map +260 -0
  26. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/Paris_1_256.map +260 -0
  27. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/brc202d.map +485 -0
  28. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/den520d.map +261 -0
  29. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/ht_chantry.map +145 -0
  30. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/ht_mansion_n.map +274 -0
  31. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/lak303d.map +198 -0
  32. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/lt_gallowstemplar_n.map +184 -0
  33. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/orz900d.map +660 -0
  34. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/ost003d.map +198 -0
  35. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/w_woundedcoast.map +582 -0
  36. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/warehouse-20-40-10-2-1.map +127 -0
  37. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/huge/warehouse-20-40-10-2-2.map +168 -0
  38. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/large/den312d.map +85 -0
  39. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/large/maze-128-128-1.map +132 -0
  40. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/large/maze-128-128-2.map +132 -0
  41. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/large/warehouse-10-20-10-2-1.map +67 -0
  42. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/large/warehouse-10-20-10-2-2.map +88 -0
  43. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/empty-32-32.map +36 -0
  44. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/empty-48-48.map +52 -0
  45. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/maze-32-32-2.map +36 -0
  46. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/maze-32-32-4.map +36 -0
  47. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/random-32-32-10.map +36 -0
  48. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/random-32-32-20.map +36 -0
  49. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/random-64-64-10.map +68 -0
  50. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/random-64-64-20.map +68 -0
  51. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/room-32-32-4.map +36 -0
  52. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/room-64-64-16.map +68 -0
  53. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/medium/room-64-64-8.map +68 -0
  54. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/small/empty-16-16.map +20 -0
  55. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/mapf-by-size/small/empty-8-8.map +12 -0
  56. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/maze-128-128-1.map +132 -0
  57. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/maze-128-128-10.map +132 -0
  58. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/maze-128-128-2.map +132 -0
  59. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/maze-32-32-2.map +36 -0
  60. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/maze-32-32-4.map +36 -0
  61. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/orz900d.map +660 -0
  62. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/ost003d.map +198 -0
  63. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/random-32-32-10.map +36 -0
  64. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/random-32-32-20.map +36 -0
  65. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/random-64-64-10.map +68 -0
  66. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/random-64-64-20.map +68 -0
  67. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/room-32-32-4.map +36 -0
  68. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/room-64-64-16.map +68 -0
  69. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/room-64-64-8.map +68 -0
  70. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/test.map +7 -0
  71. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/test2.map +7 -0
  72. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/w_woundedcoast.map +582 -0
  73. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/warehouse-10-20-10-2-1.map +67 -0
  74. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/warehouse-10-20-10-2-2.map +88 -0
  75. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/warehouse-20-40-10-2-1.map +127 -0
  76. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/mapf-map/warehouse-20-40-10-2-2.map +168 -0
  77. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/1.gml +268 -0
  78. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/1.graphml +160 -0
  79. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/2.gml +393 -0
  80. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/3.gml +375 -0
  81. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/a.gexf +154 -0
  82. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/graph.gephi +0 -0
  83. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/johnson8-2-4.mtx +212 -0
  84. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/retreat.gephi +0 -0
  85. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/road-chesapeake.mtx +172 -0
  86. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/road-euroroad.edges +1417 -0
  87. iscpp_simulator-0.1.0/src/iscpp_simulator/data/graphs/other/test.gml +117 -0
  88. iscpp_simulator-0.1.0/src/iscpp_simulator/gui.py +94 -0
  89. iscpp_simulator-0.1.0/src/iscpp_simulator/main.py +123 -0
  90. iscpp_simulator-0.1.0/src/iscpp_simulator/mapfBenchmarkProvider.py +3 -0
  91. iscpp_simulator-0.1.0/src/iscpp_simulator/mapf_benchmark_provider.py +398 -0
  92. iscpp_simulator-0.1.0/src/iscpp_simulator/simulation.py +591 -0
  93. iscpp_simulator-0.1.0/src/iscpp_simulator.egg-info/PKG-INFO +394 -0
  94. iscpp_simulator-0.1.0/src/iscpp_simulator.egg-info/SOURCES.txt +96 -0
  95. iscpp_simulator-0.1.0/src/iscpp_simulator.egg-info/dependency_links.txt +1 -0
  96. iscpp_simulator-0.1.0/src/iscpp_simulator.egg-info/entry_points.txt +2 -0
  97. iscpp_simulator-0.1.0/src/iscpp_simulator.egg-info/requires.txt +3 -0
  98. iscpp_simulator-0.1.0/src/iscpp_simulator.egg-info/top_level.txt +1 -0
@@ -0,0 +1,10 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this simulator in academic work, please cite it using this metadata."
3
+ title: "Intermittent Cooperation Multiagent Path Planning Simulation"
4
+ authors:
5
+ - family-names: "Shedlezki"
6
+ given-names: "Itay"
7
+ - family-names: "Agmon"
8
+ given-names: "Noa"
9
+ year: 2026
10
+ license: "MIT"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Itay Shedlezki and Noa Agmon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CITATION.cff
4
+ recursive-include src/iscpp_simulator/data/graphs *.edges *.gephi *.gexf *.gml *.graphml *.map *.mtx
5
+ prune graphs/scen-even
6
+ prune graphs/scen-random
7
+ global-exclude __pycache__ *.py[cod] .DS_Store
@@ -0,0 +1,394 @@
1
+ Metadata-Version: 2.4
2
+ Name: iscpp-simulator
3
+ Version: 0.1.0
4
+ Summary: Intermittent Strategic Cooperation path planning simulator
5
+ Author: Itay Shedlezki, Noa Agmon
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/shedlezki/ISCPP-Simulator
8
+ Project-URL: Repository, https://github.com/shedlezki/ISCPP-Simulator
9
+ Keywords: multi-agent path finding,path planning,simulation,cooperation
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: networkx>=2.6
22
+ Requires-Dist: matplotlib>=3.5.0
23
+ Requires-Dist: numpy>=1.21.0
24
+ Dynamic: license-file
25
+
26
+ # Intermittent Cooperation Multiagent Path Planning Simulation
27
+
28
+ This repository contains the implementation of a simulator for the **Intermittent Cooperation Path Planning (ICPP)** problem in multi-agent systems, enabling evaluation of path planning strategies where agents can benefit from selective cooperation to reduce task completion times.
29
+
30
+ ## ๐ŸŽฏ Problem Overview
31
+
32
+ In the Intermittent Cooperation Path Planning problem, agents must navigate from their starting positions to their respective goal positions in a graph-based environment. Certain nodes provide **cooperative opportunities** where agents can work together to reduce traversal time.
33
+
34
+ ### Key Concepts
35
+
36
+ - **Individual Travel Time (ฯ„โ‚)**: Time to traverse a node alone
37
+ - **Cooperative Travel Time (ฯ„โ‚‚)**: Reduced time to traverse a node when cooperating with another agent
38
+ - **Cooperation Nodes**: Specially marked nodes where agents benefit from cooperation
39
+ - **Path Planning**: Finding optimal routes that leverage cooperation strategically
40
+
41
+ ## ๐Ÿš€ Quick Start
42
+
43
+ ### Prerequisites
44
+
45
+ - Python 3.9+
46
+ - Required packages are installed automatically when installing the package.
47
+
48
+ ### Installation
49
+
50
+ ```bash
51
+ pip install iscpp-simulator
52
+ ```
53
+
54
+ For local development from a clone:
55
+
56
+ ```bash
57
+ pip install -e .
58
+ ```
59
+
60
+ ### Running the Simulator
61
+
62
+ #### Basic Usage
63
+
64
+ The project includes a simple `main.py` entry point that demonstrates the basic workflow. It finds the Shortest Independent Path (SIP) and Shortest Cooperation Path (SCP) for both agents, then uses the simulator to evaluate and visualize the resulting plans.
65
+
66
+ ```bash
67
+ # Run with default parameters (empty 8x8 map)
68
+ iscpp-simulator
69
+
70
+ # Specify a simple map from the bundled benchmark maps
71
+ iscpp-simulator -m "empty-16-16" -d 0.5 -mt 10
72
+
73
+ # Use a random simple map
74
+ iscpp-simulator --size small
75
+ ```
76
+
77
+ #### Command-Line Arguments
78
+
79
+ | Argument | Short | Type | Required | Default | Description |
80
+ |----------|-------|------|----------|---------|-------------|
81
+ | `--map` | `-m` | str | No | `empty-8-8` | Map name/path from the [MAPF benchmark provider](MAPF_BENCHMARK_PROVIDER.md) |
82
+ | `--scenario` | `-s` | str | No | - | Scenario file with agent start/goal positions (if not prvoided - starting and target nodes are auto-generated using extent and seperation parameters) |
83
+ | `--density` | `-d` | float | No | 0.5 | Ratio of cooperation nodes to all graph nodes (0.0-1.0) |
84
+ | `--magnitude` | `-mt` | int | No | 10 | Multiplication factor between non-cooperative and cooperative travel time at cooperation nodes |
85
+ | `--extent` | `-e` | int | No | 5 | Manhattan distance between each agent's start node and target node |
86
+ | `--seperation` | `-se` | int | No | 4 | Manhattan distance between the two agents' start nodes and between their target nodes |
87
+ | `--size` | `-si` | str | No | - | Random map size: `small`, `medium`, or `large` |
88
+ | `--data-dir` | - | str | No | - | External `graphs/` or `mapf-map/` directory to use instead of bundled maps |
89
+ | `--scenario-dir` | - | str | No | - | External directory containing `.scen` files |
90
+
91
+ ### Example Commands
92
+
93
+ ```bash
94
+ # Default empty map simulation
95
+ iscpp-simulator
96
+
97
+ # Simple maze map with custom cooperation parameters
98
+ iscpp-simulator -m "maze-32-32-2" -d 0.6 -mt 15 -e 7
99
+
100
+ # Use external scenario files from a local checkout or downloaded benchmark set
101
+ iscpp-simulator --scenario-dir graphs/scen-even --size small -s "even-1" -d 0.5
102
+ ```
103
+
104
+ ## ๐Ÿ–ฅ๏ธ GUI Usage
105
+
106
+ The repository includes a GUI that can be used to see an interactive visualization of paths.
107
+
108
+ ### GUI Controls
109
+
110
+ 1. **Map Visualization**: The central graph display showing:
111
+ - Regular nodes (light gray)
112
+ - Cooperation nodes (darker gray)
113
+ - Edges connecting nodes
114
+ - Agents as colored circles (Agent 1: pink, Agent 2: cyan)
115
+
116
+ 2. **Path Selection**:
117
+ - **Checkboxes** display different path options with their costs
118
+ - Format: `path <name> (cost_agent1, cost_agent2)`
119
+ - Click checkbox to highlight the path
120
+
121
+ 3. **Animation Controls**:
122
+ - **Play Button**: Animates agents following selected path
123
+ - Shows real-time agent movement and cooperation events
124
+ - Status updates show what each agent is doing
125
+
126
+ 4. **Metadata**:
127
+ - Top display shows simulation parameters (map, density, magnitude, etc.)
128
+ - **EID** (Experiment ID) can be copied to clipboard by clicking
129
+
130
+ ### Understanding the Animation
131
+
132
+ The animation displays the agentsโ€™ states at each time step, accompanied by commentary describing the current state:
133
+
134
+ - **"executes task at node X alone"**: Agent working independently
135
+ - **"cooperates with Agent Y at node X"**: Two agents cooperating
136
+ - **"waits for Agent Y at node X"**: Agent waiting for other agent to arrive
137
+ - **"travels from X to Y"**: Agent moving along edge
138
+ - **"reached target"**: Agent successfully completed journey
139
+
140
+ ## ๐Ÿ“Š Path Simulation
141
+ The simulator evaluates and visualizes path pairs supplied by the caller.
142
+ The `main.py` demonstration supplies two example path pairs:
143
+
144
+ - Shortest Independent Paths (SIP)
145
+ - Shortest Cooperation Paths (SCP)
146
+
147
+ ## ๐Ÿ—๏ธ Project Architecture
148
+
149
+ ### Core Components
150
+
151
+ #### `simulation.py` (Core Module)
152
+ - **Path Evaluation**: Evaluates discrete paths on graphs with node execution times (ฯ„โ‚ for independent execution, ฯ„โ‚‚ for cooperative execution)
153
+ - **Path Interpolation**: Converts abstract paths to time-indexed state sequences for event tracking
154
+ - **Visualization Engine**: Renders graph topology, node states, and agent positions
155
+ - `GraphVisualizer` class: Primary interface for visualization
156
+
157
+ #### `gui.py` (User Interface)
158
+ - Tkinter-based interactive interface for accessing simulator functionality
159
+ - Path selection and visualization controls
160
+ - Animation playback for step-by-step analysis
161
+ - Experiment metadata display and tracking
162
+
163
+ #### `mapfBenchmarkProvider.py` (Data Interface)
164
+ - Loads MAPF (Multi-Agent Path Finding) benchmark maps
165
+ - Converts map files to graph representations
166
+ - Generates cooperation node distributions based on specified parameters
167
+ - See the [MAPF benchmark provider](MAPF_BENCHMARK_PROVIDER.md) page for more details
168
+
169
+ #### `main.py` (Demonstration)
170
+ - Example usage of the simulator
171
+ - Command-line interface for common scenarios
172
+ - Handles argument parsing and map/scenario loading
173
+ - Demonstrates integration of multiple path planning strategies
174
+
175
+ ### Data Flow
176
+
177
+ ```
178
+ Command-line arguments
179
+ โ†“
180
+ Map/Scenario Loading (mapfBenchmarkProvider)
181
+ โ†“
182
+ Graph Construction & Cooperation Node Generation
183
+ โ†“
184
+ Path Planning
185
+ โ†“
186
+ Path Interpolation (simulation)
187
+ โ†“
188
+ GUI Creation & Visualization (gui)
189
+ โ†“
190
+ User Interaction & Animation
191
+ ```
192
+
193
+ ## ๐Ÿ“ Directory Structure
194
+
195
+ ```
196
+ project/
197
+ โ”œโ”€โ”€ README.md # This file
198
+ โ”œโ”€โ”€ DOCUMENTATION.md # Detailed technical documentation
199
+ โ”œโ”€โ”€ ARCHITECTURE.md # System architecture guide
200
+ โ”œโ”€โ”€ pyproject.toml # Python package metadata
201
+ โ”œโ”€โ”€ src/
202
+ โ”‚ โ””โ”€โ”€ iscpp_simulator/
203
+ โ”‚ โ”œโ”€โ”€ main.py # Main entry point
204
+ โ”‚ โ”œโ”€โ”€ mapf_benchmark_provider.py # Map and scenario loading
205
+ โ”‚ โ”œโ”€โ”€ simulation.py # Visualization and animation
206
+ โ”‚ โ”œโ”€โ”€ gui.py # GUI interface
207
+ โ”‚ โ””โ”€โ”€ data/graphs/ # Bundled maps and non-scenario graphs
208
+ โ”œโ”€โ”€ graphs/
209
+ โ”‚ โ”œโ”€โ”€ scen-even/ # Even-distribution scenarios
210
+ โ”‚ โ””โ”€โ”€ scen-random/ # Random scenarios
211
+ ```
212
+
213
+ PyPI builds include the bundled maps and graph files under
214
+ `src/iscpp_simulator/data/graphs/`, but exclude the heavier `.scen` scenario
215
+ files. Scenario mode remains available by passing `--scenario-dir`.
216
+
217
+ ## ๐Ÿ”ง Advanced Usage
218
+
219
+ ### Custom Map Creation
220
+
221
+ Maps must be in the MAPF `.map` format:
222
+
223
+ ```
224
+ type octile
225
+ height 8
226
+ width 8
227
+ map
228
+ . . . . . . . .
229
+ . @ @ . . . . .
230
+ . @ @ . . . @ @
231
+ . . . . . . . .
232
+ ...
233
+ ```
234
+
235
+ Where:
236
+ - `.` = free cell
237
+ - `@` or `T` = obstacle
238
+ - `X` = cooperation node (extension for ICMPP instances)
239
+
240
+ ### Custom Scenarios
241
+
242
+ Scenario files (`.scen`) follow the standard MAPF scene format. After the
243
+ `version` header, each row describes one agent:
244
+
245
+ ```
246
+ version 1
247
+ bucket map width height start_x start_y goal_x goal_y optimal_length
248
+ 0 empty-8-8.map 8 8 0 0 7 7 14
249
+ 1 empty-8-8.map 8 8 0 7 7 0 14
250
+ ...
251
+ ```
252
+
253
+ Where:
254
+ - `bucket` = numerical scenario ID, often arbitrary or used to number agents
255
+ - `map` = map file associated with the scenario
256
+ - `width` and `height` = grid dimensions
257
+ - `start_x` and `start_y` = agent start coordinates
258
+ - `goal_x` and `goal_y` = agent goal coordinates
259
+ - `optimal_length` = shortest start-to-goal path length for that agent when
260
+ other agents are ignored, usually computed with octile or Manhattan distance
261
+
262
+
263
+ ### Extending Path Planners
264
+ A joint path is represented as a tuple of per-agent path results. Each
265
+ agent result is a dictionary with a `path` key containing an ordered list of
266
+ node IDs from start to goal, and a `length` key containing the total path cost.
267
+
268
+ Paths may also contain synthetic wait markers in the form `WAIT_<n>`, where
269
+ `n` is the number of time steps an agent waits before continuing. These markers
270
+ are not graph nodes; they are inserted between real node IDs to encode
271
+ synchronization delays, specifically when one agent must wait for another before
272
+ cooperating at a node. Simulation and visualization code include their duration when computing the
273
+ time-indexed agent states.
274
+
275
+ To add a custom path planning strategy:
276
+
277
+ 1. Create a function in `main.py`:
278
+ ```python
279
+ def custom_path_strategy(G, v_s, v_g):
280
+ # Your algorithm here
281
+ return {'path': path, 'length': cost}
282
+ ```
283
+
284
+ 2. Add to paths dictionary:
285
+ ```python
286
+ paths["Custom Strategy"] = (
287
+ custom_path_strategy(G, 's_1', 'g_1'),
288
+ custom_path_strategy(G, 's_2', 'g_2')
289
+ )
290
+ ```
291
+
292
+ 3. Results will appear as selectable options in the GUI
293
+
294
+ ## ๐Ÿ“ˆ Key Parameters Explained
295
+
296
+ ### Cooperation Density (`-d`, `--density`)
297
+ - **Range**: 0.0 to 1.0
298
+ - **Effect**: Controls the ratio of cooperation nodes to all nodes in the graph
299
+ - **Higher values**: More opportunities for cooperation
300
+ - **Lower values**: Sparser cooperation opportunities
301
+
302
+ ### Cooperation Magnitude (`-mt`, `--magnitude`)
303
+ - **Range**: Integer > 0
304
+ - **Effect**: Sets the multiplication factor between non-cooperative and cooperative travel time at cooperation nodes
305
+ - **Calculation**: cooperative travel time is derived from non-cooperative travel time using this factor
306
+ - **Higher values**: Greater cooperation benefit
307
+
308
+ ### Extent (`-e`, `--extent`)
309
+ - **Range**: Integer > 0
310
+ - **Effect**: Manhattan distance between each agent's starting node and target node
311
+ - **Higher values**: Longer start-to-target task distance
312
+
313
+ ### Separation (`-se`, `--seperation`)
314
+ - **Range**: Integer > 0
315
+ - **Effect**: Manhattan distance between the two agents' starting nodes and between the two agents' target nodes
316
+ - **Higher values**: Agents start and finish farther apart
317
+
318
+ ## ๐Ÿงช Testing & Examples
319
+
320
+ ### Example 1: Basic Comparison
321
+ ```bash
322
+ iscpp-simulator
323
+ # Compares shortest independent vs. cooperative paths on default 8x8 map
324
+ ```
325
+
326
+ ### Example 2: Simple Scenario
327
+ ```bash
328
+ iscpp-simulator -m "empty-16-16" -s "empty-16-16-even-1" -d 0.4 -mt 20
329
+ # Uses a simple 16x16 empty map with first even-distribution scenario
330
+ # 40% cooperation nodes with benefit of 20 time units
331
+ ```
332
+
333
+ ### Example 3: Parameter Sweep
334
+ ```bash
335
+ for d in 0.3 0.5 0.7; do
336
+ for mt in 5 10 15; do
337
+ iscpp-simulator -d $d -mt $mt
338
+ done
339
+ done
340
+ ```
341
+
342
+ ## ๐Ÿค Contributing
343
+
344
+ Enhancements welcomed in:
345
+ - Additional path planning algorithms
346
+ - New visualization features
347
+ - Performance optimizations
348
+ - Support for more than 2 agents
349
+ - Integration with other MAPF research
350
+
351
+ ## ๐Ÿ“š References
352
+
353
+ This project is based on research in Intermittent Strategic Cooperation of Two Selfish Agents on Graphs (IC2PP). The benchmark maps and scenarios are from the MAPF community benchmarks.
354
+
355
+ ### Related Work
356
+ - {Link to paper}
357
+
358
+ ## ๐Ÿ“– Citation
359
+
360
+ If you use this simulator in academic work, please cite it as:
361
+
362
+ ```bibtex
363
+ @software{shedlezki_2026_icpp_simulation,
364
+ author = {Shedlezki, Itay and Agmon, Noa},
365
+ title = {Intermittent Cooperation Multiagent Path Planning Simulation},
366
+ year = {2026},
367
+ license = {MIT}
368
+ }
369
+ ```
370
+
371
+ ## โš™๏ธ System Requirements
372
+
373
+ - **Python**: 3.7+
374
+ - **Memory**: 512 MB minimum
375
+ - **Disk**: 100 MB for benchmark datasets
376
+ - **Display**: Required for GUI (X11/Wayland on Linux, native on Windows/macOS)
377
+
378
+
379
+ ## ๐Ÿ“ License
380
+ This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
381
+
382
+ ## Authors
383
+
384
+ **Itay Shedlezki** (Corresponding Author)
385
+ - Email: i.shedlezki@gmail.com
386
+ - Affiliation: Department of Computer Science and Artificial Intelligence, Bar-Ilan University, Ramat Gan, Israel
387
+
388
+ **Noa Agmon**
389
+ - Email: agmon@cs.biu.ac.il
390
+ - Affiliation: Department of Computer Science and Artificial Intelligence, Bar-Ilan University, Ramat Gan, Israel
391
+
392
+ ---
393
+
394
+ For detailed technical information, see [DOCUMENTATION.md](DOCUMENTATION.md) and [ARCHITECTURE.md](ARCHITECTURE.md).