Multi-threaded simulation framework for an autonomous vacuum cleaner, designed as part of an advanced programming course. The system efficiently cleans dynamically defined environments using modular, optimized algorithms. The architecture supports multiple algorithms, parallel execution, and a competitive scoring mechanism.
- Multi-Threaded Simulation: Runs multiple cleaning algorithms concurrently for performance evaluation.
- Modular Algorithm Design: Supports dynamically loaded algorithms via shared libraries (.so files).
- Scalable House Representation: Handles various house layouts with different sizes, dirt levels, and obstacles.
- Pathfinding Optimization: Implements DFS-based exploration and BFS-based shortest path calculations.
- Performance Scoring: Evaluates algorithms using an optimized scoring function (based on efficiency, coverage, and docking success).
- Error Handling & Logging: Robust error reporting with separate logs for invalid houses and algorithms.
- Automated Testing & Benchmarking: Runs all possible algorithm-house combinations and generates detailed performance summaries.
- Simulator: Loads house files and algorithm shared libraries, manages simulation runs, and records results.
- Algorithms:
- DFS Algorithm: Uses Depth-First Search for exploration, mapping the environment dynamically.
- Spiral Algorithm: Prioritizes structured movement for optimized coverage while minimizing redundant steps.
- Input:
- House File (.house): Defines the environment layout, including walls (W), open spaces ( ), dirt levels (0-9), and a single docking station (D).
- Algorithm Files (.so): Shared object libraries containing cleaning strategies that get dynamically loaded.
- Output
- Simulation Output: Logs vacuum steps, remaining dirt, status (FINISHED, WORKING, DEAD), and performance score.
- Summary Report (.csv): Aggregates results across multiple runs for benchmarking.
./myrobot -house_path=houses/ -algo_path=algorithms/ -num_threads=10 -summary_only-house_path=<directory>: Specifies the directory containing.housefiles. Defaults to the current directory if not provided.-algo_path=<directory>: Specifies the directory containing algorithm.sofiles. Defaults to the current directory if not provided.-num_threads=<number>: Limits the number of concurrent threads. Defaults to 10.-summary_only: Generates only thesummary.csvfile, skipping individual simulation logs.-log: Enables logging for each algorithm-house pair, saving detailed execution logs.
- House File (.house): Defines the environment layout, including walls (W), open spaces ( ), dirt levels (0-9), and a single docking station (D).
- Algorithm Files (.so): Shared object libraries containing cleaning strategies that get dynamically loaded.
- Simulation Log: Steps taken, dirt remaining, vacuum status (FINISHED/WORKING/DEAD), docking status (TRUE/FALSE).
- Summary Report (.csv): Performance metrics for multiple algorithm-house combinations.

