How yzeit/mogphh works
Project type and purpose
• From the file tree and README, this is not a web‐service or UI application but a research‐oriented algorithmic framework (“MOGPHH”) that evolves multi‐objective dispatching rules using genetic programming hyper‐heuristics (GP‐HH), with surrogate models to speed up fitness evaluation.
• It targets dynamic job shop scheduling experiments, comparing surrogate‐assisted and simulation‐only approaches.
File structure
• Top-level scripts:
• main.py – orchestrates 30 runs of the GP‐HH framework
• GPHH.py – defines terminals, functions, GP parameters
• simulation.py – discrete‐event simulation for true fitness
• surrogates.py – implementations of surrogate models (SR, RF, DT, NB)
• phenotypic_generator.py – computes feature vectors for individuals
• testing.py – evaluates final populations on hold‐out instances
• deap/algorithms.py – contains NSGA‐II loops and implementations of 6 experiment algorithms (with/without surrogates, duplicate elimination)
• experiments/ – post‐processing scripts (Experiment1–Experiment5) to generate visualizations (accuracy/time, convergence curves, boxplots, population analyses, testing results)
• LICENSE, README.md – documentation
Extract architecture cues from the README
• The README outlines components (“pre‐selection task in NSGA‐II,” phenotypic characterization, surrogate categories) and the data flow: GP evolution → fitness evaluation (simulation or surrogate) → post‐processing → visualization.
• Key external dependencies: DEAP library for GP, machine learning libs (e.g., scikit‐learn) for surrogates.
Main components
a. Orchestrator (main.py)
b. GP Engine
– GPHH.py (GP settings, terminals/functions)
– deap/algorithms.py (evolution loop, NSGA‐II)
c. Fitness‐Evaluation Layer
– Simulation Engine (simulation.py)
– Surrogate Module (surrogates.py)
– Phenotypic Feature Generator (phenotypic_generator.py)
d. Evaluation & Testing (testing.py)
e. Experiments & Visualization (experiments/Experiment*.py)
f. External Dependencies
– DEAP
– ML libraries (scikit‐learn)
Relationships and data flow
• main.py → invokes one of the six GP‐HH algorithms in deap/algorithms.py
• GP loop (in deap/algorithms.py):
– Population initialization → phenotypic_generator →
– if using surrogate: surrogate.predict(fitness)
– else: simulation.simulate(fitness)
– Selection, crossover, mutation → next generation
– repeat until termination
• Final Pareto set → testing.py → generate performance metrics
• experiments/*.py consume logs and results → generate plots and tables
Architectural patterns & principles
• Modular pipeline: clear separation between orchestration, algorithm core, evaluation (simulation vs. surrogate), and post‐processing
• Strategy pattern: interchangeable fitness evaluators (simulation or various surrogates) plugged into the same GP loop
• Single Responsibility: each module handles one concern (GP settings, simulation, surrogate, feature extraction, testing, visualization)
Elements
• Blue – Core GP Engine
• Green – Fitness Evaluation (Simulation vs. Surrogate)
• Orange – Feature Extraction (phenotypic)
• Gray – Post‐Processing & Visualization
– Annotations for external dependencies (DEAP, scikit‐learn)
Final remarks
• Be very detailed: capture each algorithm variant (WS, SR, RF, RF_dup, DT_dup, NB_dup) as options in the surrogate module.
• Data flows and decision points (surrogate vs. true simulation).
• Use labels and callouts to show key file‐to‐module mappings (e.g., deap/algorithms.py ≡ GP Engine loop).
• This level of granularity ensures that any new engineer can see exactly how each piece of code fits into the overall research pipeline.