How ura-project/libess works
Main Components
• Data Layer: Represented by the “data” directories in each variant folder (GA, NSGA, PMSBX_GA, PMSBX_NSGA_II) that hold input files like resource.csv and supply_orders.csv. Additionally, there’s a “save_data” folder holding various JSON and population snapshots which represent the persistent storage of computational results (e.g., best_solution.json, population_gen_X.json).
• Algorithm Engine: This consists of the core optimization modules spread across multiple directories. Each variant has its own implementation:
– GA and NSGA variants have their respective “src/ga” or “src/nsga” subdirectories that include initialization, core algorithm, and utility modules.
– The “check_the_formula” directories, containing crossover.py and mutation.py, indicate encapsulated routines for genetic operators used during evolution.
– The shared “src/algorithm.py”, “src/parameters.py”, and “src/all_packages.py” support the overall execution of the algorithms.
• Visualization Component: The “chart” directories (present in each main variant folder) with the draw_chart.py file are dedicated to plotting and visualizing evolution results like fitness and Pareto fronts. The additional PDF files (evolution_charts.pdf, combined_charts.pdf, etc.) further support the visualization process.
• Entry Points: Each variant has its own main.py which acts as the driver for running that specific algorithm implementation.
• Logging & Reporting: Textual logs and violation indicators (for battery and deadline constraints) as well as the pareto_front related files indicate continuous evaluation and reporting during execution.
• Main Execution (main.py)
• Data Handling: reading input CSV files and saving data (via save_load_data modules and “save_data” directory)
• Algorithm Core: running optimization routines (algorithm.py, parameters.py, and the variant-specific submodules)
• Genetic Operators: using crossover.py and mutation.py from the “check_the_formula” component.
• Visualization: calling chart/draw_chart.py to generate performance charts.
• Data Flow from “data” directories into the Algorithm Engine.
• Algorithm processing results being passed onto the Charting modules.
• Outputs being saved to the “save_data” folder.
• Logging outputs (logfile.log, violation texts, pareto set files) being generated as a result of the algorithm’s execution.
Architectural Patterns and Design Principles
• Modularity: Notice how each evolutionary algorithm variant has its own complete structure (with dedicated src, chart, data, and check_the_formula folders). This modular design enhances experimental flexibility and side-by-side comparisons.
• Reuse of Core Components: Shared modules (like algorithm.py, parameters.py, etc.) suggest a design focused on reusability and consistency across different algorithm implementations.
• Separation of Concerns: The clear separation between data management, algorithm logic, and visualization/reporting implies adherence to sound design principles.
Putting It Together
• Within this, create sub-clusters for each variant (GA, NSGA, PMSBX_GA, PMSBX_NSGA_II).
• From there, illustrate calls to the algorithm core (algorithm.py, parameters.py, plus the variant-specific submodules in src/ga, src/nsga, etc.).
• Genetic operators as separate nodes linked to the algorithm core.
• Finally, have the algorithm output feed into the chart/draw_chart.py module for generating visualizations, with results and logs stored in save_data and log files.