This project simulates a small asynchronous distributed system with multiple virtual machines running at different speeds, each maintaining their own logical clock according to Lamport's logical clock rules.
Design notebook: notebook.md
Other entries:
Results: analysis.ipynb
- Multiple processes?
virtual_machine.py,simulation_controller.py - Follow the specifications?
virtual_machine.py,simulation_controller.py - Observations leading to conclusions?
analysis.ipynb - Tried the described variations?
analysis.ipynb - Bonus?
analysis.ipynb
The simulation creates multiple virtual machines that:
- Run at different clock rates (1-6 ticks per second)
- Communicate with each other via sockets
- Maintain message queues for incoming messages
- Update logical clocks based on internal events and message passing
- Log all activities to individual log files
virtual_machine.py- Implements the VirtualMachine class that models a single machinesimulation_controller.py- Controls the initialization and execution of the model by running VMslog_analyzer.py- Analyzes and visualizes the results of the simulationlogs/- Directory where machine logs are storedtest_simulation_controller.py- unit teststest_virtual_machine.py- unit tests
After cloning the repo, you may need to use the setup script to setup the environment with required dependencies by running:
chmod +x setup
./setupRest (running the model and generating results plot), following:
analysis.ipynb