This project is created for our masters course "Computer networks and distibuted systems" at ELTE, this is a Student Project, that is an implementation of the following paper: Time, Travel, and Energy in the Uniform Dispersion Problem by Michael Amir, Alfred M. Bruckstein
This project simulates the uniform dispersion of robots in a grid field. The robots navigate through the field, avoiding obstacles and ensuring even distribution.
The Uniform Dispersion Problem involves distributing robots uniformly across a field while avoiding obstacles. This project provides a visual simulation of this problem, allowing users to load different field configurations and observe the robots' behavior.
Note
This algorithm only works on "simply connected environments" that is an environment where the free cells form a connected graph, and the complementer of the free cells also form a connected graph.
Check out the hosted version of the project here.
-
Clone the repository:
$ git clone https://github.com/Kristofy/uniform-dispersion-problem.git $ cd uniform-dispersion-problem -
Start a webserver in the
srcdirectory$ cd src $ python3 -m http.server -
Open the hosted version in a browser.
-
Load a Field Configuration:
- Click the "Load Level" button to select a field configuration from the
./palyakdirectory.
- Click the "Load Level" button to select a field configuration from the
-
Start/Pause the Simulation:
- Use the "Start/Pause" button to control the simulation.
-
Adjust Simulation Speed:
- Use the speed slider to change the simulation speed.
-
Toggle Asynchronous Mode:
- Use the async switch to toggle between synchronous and asynchronous robot movements.
-
Inspect Field Cells:
- Click on cells in the field to view their details.
Create a pixel image with the following colors to define a custom field configuration:
- White: Empty cell
- Black: Wall
- Red: Robot spawn point
Put your custom field image in the ./palyak directory, add it to the palyak/levels.json and after reloading the webserver load it using the "Load Level" button.
Every pixel will be snapped to the nearest valid cell color
src/algorithms.js: Contains the algorithms for robot movement.
src/app.js: Main application logic and event handling.
src/cell.js: Defines different types of cells in the field.
src/field.js: Manages the field and its cells.
src/image.js: Handles image processing for field configurations.
src/index.html: Main HTML file for the project.
src/palyak/: Directory containing field configuration images.
src/settings.js: Manages simulation settings.
src/vector.js: Defines vector operations used in the project.
Every js file is an ES6 module and everything is typed with JSDoc