Skip to content

Implement imitation learning framework for job-shop scheduling with DAgger and pilot heuristics#1

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-imitate-learning-job-shop-scheduling
Draft

Implement imitation learning framework for job-shop scheduling with DAgger and pilot heuristics#1
Copilot wants to merge 3 commits intomainfrom
copilot/add-imitate-learning-job-shop-scheduling

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 21, 2026

Implements complete imitation learning framework for job-shop scheduling problems, supporting the LION20 conference paper on expert-like lookahead policies via pilot heuristics.

Core Package (pilotjsp/)

Instance Management (jsp_instance.py)

  • OR-Library format I/O for 10×10 JSP instances
  • Random instance generation with configurable seeds
  • CSV export/import for data analysis

Feature Extraction (features.py)

  • 13 dispatching rule features: PT, RPT, NRO, WR, ST, CR, SPT, EDD, FCFS, MW, MWT, ODD, TWC
  • Batch extraction and normalization
  • CSV persistence

Expert Solver (expert.py)

  • Gurobi MIP formulation for optimal scheduling
  • Disjunctive constraints for machine capacity
  • Fallback to SPT heuristic when Gurobi unavailable

Preference Learning (preferences.py)

  • Pairwise preferences from expert trajectories
  • Rollout-based preference generation
  • Training data aggregation with CSV I/O

DAgger Algorithm (dagger.py)

  • Dataset aggregation with exponential beta decay
  • Mixed expert/learned policy rollouts
  • Training history tracking

Ordinal Regression (model.py)

  • Hinge loss on preference pairs: max(0, -label × (score₁ - score₂) + margin)
  • L2 regularization
  • Feature importance via weight magnitudes

Pilot Heuristic (pilot.py)

  • Configurable lookahead depth for decision evaluation
  • Rollout simulation with learned base policy
  • Makespan estimation for partial schedules

Utilities (utils.py)

  • CSV/JSON serialization with numpy type handling
  • Statistics computation
  • Incremental logging

Configuration & Scripts

  • config.yaml: Hyperparameters for expert, DAgger, model, pilot settings
  • scripts/setup.py: Directory initialization and sample data
  • scripts/run_example.py: End-to-end workflow demonstration
  • scripts/evaluate.py: Baseline comparisons (SPT, LPT, FCFS, random)

Usage Example

from pilotjsp import JSPInstance, FeatureExtractor, OrdinalRegressionModel, PilotHeuristic

# Generate instance and extract features
instance = JSPInstance.generate_random(n_jobs=10, n_machines=10, seed=42)
extractor = FeatureExtractor(instance)

# Train model from preference pairs
model = OrdinalRegressionModel(n_features=13)
model.fit(features1, features2, labels)

# Evaluate pilot heuristic
pilot = PilotHeuristic(instance, extractor, model, rollout_depth=5)
solution = pilot.solve()
print(f"Makespan: {solution['makespan']}")

Dependencies

Requires: numpy, pyyaml, scikit-learn, matplotlib, pandas. Optional: gurobipy (for expert solver).

Original prompt

Create a Python repo “pilotJSP” for imitation learning in job-shop scheduling. Generate code to: make OR-Library 10x10 JSP instances, extract 13 DR features, query a Gurobi MIP expert, build preference pairs, run DAgger, train an ordinal-regression model, and evaluate a pilot rollout heuristic. Include CSV data handling, a config file, and basic scripts.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 21, 2026 14:53
Co-authored-by: tungufoss <3079749+tungufoss@users.noreply.github.com>
Co-authored-by: tungufoss <3079749+tungufoss@users.noreply.github.com>
Copilot AI changed the title [WIP] Create pilotJSP repository for imitation learning in job-shop scheduling Implement imitation learning framework for job-shop scheduling with DAgger and pilot heuristics Jan 21, 2026
Copilot AI requested a review from tungufoss January 21, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants