Skip to main content

Pro Machina

A production scheduling toolkit for optimising complex manufacturing processes.

Introduction

A number of highly complex problems arise in the planning of production across multiple machines within a production facility. This problem, although it is NP-Hard, is heavily studied and often referred to as the Job-shop scheduling problem or, more broadly, Optimal job scheduling. These problems are often approached using some form of linear programming to maximise a cost function and, indeed, there are many articles and libraries to support manufacturers in this area.

However, all of these approaches assume that production runs are for fixed periods of time. That is, if you have three tasks (A, B and C), you know how long each of those tasks take, and you have to ensure that A is completed before B, and B before C etc. That is not how things work in many manufacturing environments, particularly in relation to Fast-Moving Consumer Goods (FMCG) / Consumer Packaged Goods (CPG).

That is the domain of Pro Machina.

Scenario

You are trying to optimise production across a sweet factory (this is based on a real example where this model was first developed):

  • 88 machines across 7 departments
  • 650 WIP items (individual type of sweet) can be produced across those machines
  • Machines have complex shift patterns
  • 200 Finished Products (that is, unique mixtures of sweets from multiple departments in varying proportions) have an aggregated sales forecast
  • Storage of stock is limited. Overproduction of one item will consume storage space. However, only having 9 WIP components out of 10 required to meet the product specification means that the finished product cannot be made at all
  • Major supermarkets can impose severe fines for missed OTIF targets
  • Upstream of making the individual sweets, batches of the hot sugar syrup need to be made and used within a set time period but can be allocated to multiple different WIP items, across multiple machines
  • Production runs of any one sweet can be entirely variable. You could run the machine making one WIP item for anywhere between two hours and 24 hours. The machines also run at different speeds depending on the WIP they are producing
  • Machines run slower during the summer months because the high humidity causes the batch rollers to slip on the hardening sugar
  • Some machines can be reconfigured at short notice (i.e. change a die in the press) to swap to producing an entirely different subset of WIP items
  • Halloween is a massive rush period, so products for these promotional items will need to be stockpiled
  • Gelatin-free variants of WIP items require a machine shutdown for deep cleaning, so product categories should be grouped together where practical

... and the list goes on. Particularly with the variable-length production runs, this kind of problemn is unsuitable to traditional approaches to optimisation. Pro Machina takes a custom heuristic approach to solving this problem.

Status

Although such a model has been built and used in production for over 6 years now for the above scenario, an attempt is being made here to generalise the kind of constraints to be applicable across the FMCG industry. Right now, the package itself is very much WIP itself, focused on getting the fundamentals right to support such a broad range of constraints.

Installation and Use

pip install pro_machina

The vast majority of the interface is fully documented in the library itself but the constraint interface is currently under development. The best way to see how the library works is to look in the examples folder (examples 01-04 for now) to see the direction of travel.

Metadata

Release files for pro-machina 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pro-machina 0.0.1
File Size Uploaded Provenance Actions
pro_machina-0.0.1.tar.gz 53.9 kB Without provenance Details for pro_machina-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pro-machina 0.0.1
File Interpreter ABI Platform Actions
pro_machina-0.0.1-py3-none-any.whl Python 3 none any Details for pro_machina-0.0.1-py3-none-any.whl

Total release size: 96.4 kB

Release files / pro_machina-0.0.1.tar.gz

Download URL pro_machina-0.0.1.tar.gz
Size 53.9 kB
Tags Source
SHA-256 checksum
How to use checksums
18d25e7cbf5caf42bb70fe89cc09f97146ee403665559d4a5f0e3973d1262757
BLAKE2b-256 checksum
How to use checksums
c67850c30472830193dba7dde09b03966a2c27e272ce7f840ed5679bbd844ee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / pro_machina-0.0.1-py3-none-any.whl

Download URL pro_machina-0.0.1-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea355dce76e53dc417915347c1aa98f1bc7f64f7bcc04f26bf353a299be79d13
BLAKE2b-256 checksum
How to use checksums
829c39d41cedbb1f4fbb68d0dfcb5cddadb4950cf59c5967b0f30b52a2872e16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for pro-machina 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page