FJSP Baseline Repair Skill
Overview
Repairs Flexible Job-Shop Scheduling baseline schedules that have downtime violations. Produces a feasible schedule with minimized makespan while respecting:
- Machine eligibility and correct durations
- Intra-job precedence ordering
- No machine overlap (half-open intervals)
- Zero downtime violations
- Right-shift-only constraint
- Freeze policy for early operations
- Machine change and L1 shift budgets
- Makespan ratio guard
Scripts
scripts/parser.py- Parse instance, downtime, policy, baseline filesscripts/constraints.py- Validation functions for all constraint typesscripts/solver.py- Greedy repair algorithms with multiple strategiesscripts/writer.py- Write solution.json and schedule.csv outputsscripts/entrypoint.py- End-to-end pipeline: parse, repair, validate, write
Usage
pythonimport sys sys.path.insert(0, '/app/environment/skills/evo-fjsp-repair/scripts') from entrypoint import run, validate # Run full pipeline result = run('/app/data', '/app/output') # Validate outputs valid = validate('/app/output', '/app/data') if not valid: print("Schedule has issues - check output")
Algorithm
- Parse all input files
- Identify frozen operations (baseline start < freeze_until)
- Identify frozen ops with downtime violations (must be reassigned)
- Process operations in precedence-aware order (op index asc, baseline start asc)
- For each operation, find earliest feasible start on each eligible machine
- Select assignment minimizing end time while staying within policy budgets
- Try multiple strategies (minimize end time vs minimize duration) and pick best
- Write outputs and validate


