hives: a swarm guidance simulator for p2p networks
Hives
Hives a quick to edit and setup simulator is written in Python 3.7, which offers it's users a way of testing the performance of Swarm Guidance Algorithms and Markov Matrix related optimizations in a distributed backup system scenario based on P2P networks.
New Features!
-
Generate a simulation file using simfile_generator.py script.
Long option Short option Argument Type Description --file -f str Creates a simulation file with specified name. -
Run one or multiple simulations using hive_simulation.py script.
Long option Short option Argument Type Description --file -f str Executes the specified simulation file. --directory -d void Executes all simulation files available in the SIMULATION_ROOT folder. --threading -t int The number of worker threads. Each thread runs one simulation instance. --iterations -i int How many times each simulation file is executed. --epochs -e int The number of discrete time steps each execution lasts. -
Configure the simulation environment by changing the variables inside globals.py file.
See more details by consulting the file's docstrings. Some variables include replication level, corruption chances, absolute tolerance for vector comparison and, others.
-
Simulations output one JSON file that can be used to post-process results at the user's will.
Tech
Installation
This project is implemented using Python 3.7.6. You are free to use any version you desire, but we do not guarantee the simulator will work under such conditions. We know that any version launched before 3.7.x will not run this project. We also recommend using an IDE such as PyCharm or equivalent for easier usage.
-
Download and install Python 3.7.7
-
Download our repository
-
Create a virtual environment of your choosing.
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
-
Install project dependencies by opening your terminal and inserting the command:
$ pip install -r requirements.txt
Usage
A typical usage of this simulator would be the following sequence of commands (see New Features! section for flag details):
$ python simfile_generator.py --file=test01.json
$ python hive_simulator.py --file=test01.json --iters=30 --threading=4 --epochs=720
Future Releases
Future releases will focus on slightly improving the failure detection model. Instead of using perfect detection with a monitor entity, we will have perfect detection based on network node complaints. We will also have a module that prototypes HDFS to compare simulation results using the Swarm Guidance algorithms and an HDFS heartbeat model.
License
AGPL-3.0 License