Skip to content

feat: add factory simulation demo with maintenance optimisation#215

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-factory-simulation-demo
Draft

feat: add factory simulation demo with maintenance optimisation#215
Copilot wants to merge 4 commits intomainfrom
copilot/add-factory-simulation-demo

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Summary

New demo simulating a factory with 5 machines over 365 days. Each machine has sigmoid-based breakdown probability, configurable proactive maintenance intervals, and fixed repair downtime. Includes a tuner config to optimise maintenance schedules for maximum output, a Jupyter notebook for interactive exploration, and a mermaid process diagram.

Changes

  • Iterator component drives the simulation for a configurable number of days
  • Machine component (5 instances with distinct parameters):
    • $10k/day output when running
    • Breakdown probability: 1 / (1 + exp(-k * (days_since_maintenance - midpoint))) — different k and midpoint per machine
    • 5-day downtime on breakdown, 1-day downtime for scheduled maintenance
    • Seeded RNG for reproducibility
  • Factory component aggregates daily output across all machines into cumulative total
  • factory-simulation.yaml wires the process and defines a Tuner config optimising each machine's maintenance_interval (range 5–60 days) to maximise total_value
  • build_process_spec() helper constructs the ProcessSpec programmatically for use with ProcessBuilder or Tuner
  • factory-simulation.ipynb Jupyter notebook that imports components from factory_simulation.py, builds the process, includes a mermaid diagram (static image + dynamic MermaidDiagram.from_process() generation), runs the simulation with results/efficiency metrics, and explains the optimisation setup
  • mkdocs.yaml updated to include the notebook under Demos > Fundamentals > Factory simulation
# Run single simulation
python factory_simulation.py
# Total factory output over 365 days: $14,790,000

# Optimisation (requires Ray) — uncomment in __main__
run_optimisation()

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 28, 2026 20:38
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add factory simulation demo with machine management feat: add factory simulation demo with maintenance optimisation Feb 28, 2026
Copy link
Contributor

@toby-coleman toby-coleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Include a Jupyter notebook as well (it could import Components from factory_simulation.py). It should be in a similar format to the other demo notebooks, and be referenced in the mkdocs yaml to publish as documentation. Include a mermaid diagram of the process that you built.

Co-authored-by: toby-coleman <13170610+toby-coleman@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 28, 2026

@copilot Include a Jupyter notebook as well (it could import Components from factory_simulation.py). It should be in a similar format to the other demo notebooks, and be referenced in the mkdocs yaml...

Added in 52ac46a. The notebook factory-simulation.ipynb imports components from factory_simulation.py, includes a mermaid process diagram (both a static mermaid.ink image and a dynamic MermaidDiagram.from_process() cell), and is referenced in mkdocs.yaml under Demos > Fundamentals > Factory simulation. Verified the mkdocs build succeeds with the new entry.

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