Skip to main content

Factory Operations Research & Optimisation Library

Project description

factory-optimizer

Factory Operations Research & Optimisation Library

A Python library that solves real factory operations problems using proven OR (Operations Research) techniques. Give it your factory data — materials, costs, supply, demand — and it returns the mathematically optimal plan.


Install

pip install factory-optimizer

Quick Start

from factory_optimizer import FactoryOptimizer

fo = FactoryOptimizer()
# A welcome guide prints automatically on first import!

What it solves

Problem Method Function
Production Planning Linear Programming (Simplex) optimize_production()
Transportation / Distribution Vogel's Approximation (VAM) optimize_transportation()
What-if analysis Scenario simulation engine simulate_production() / simulate_transportation()

Usage

1. Production Planning

result = fo.optimize_production(
    resources={"material_A": 500, "material_B": 300},
    products={
        "prod_1": {"materials": {"A": 2, "B": 1}, "profit": 50},
        "prod_2": {"materials": {"A": 1, "B": 2}, "profit": 40},
    },
    report=True   # prints a formatted console report
)

print(result["quantities"])    # {"prod_1": 233.33, "prod_2": 33.33}
print(result["total_profit"])  # 13000.0

2. Transportation Planning

result = fo.optimize_transportation(
    supply={"Factory_1": 100, "Factory_2": 150},
    demand={"Customer_1": 80, "Customer_2": 120, "Customer_3": 50},
    cost_matrix=[[4, 6, 8],
                 [5, 4, 3]],
    report=True
)

print(result["total_cost"])  # 990.0
print(result["plan"])        # {"Factory_1": {"Customer_1": 80, ...}, ...}

3. Scenario Simulation

sim = fo.simulate_production(
    resources={"material_A": 500, "material_B": 300},
    products={
        "prod_1": {"materials": {"A": 2, "B": 1}, "profit": 50},
        "prod_2": {"materials": {"A": 1, "B": 2}, "profit": 40},
    },
    scenarios=[
        {
            "name": "Material A supply +20%",
            "changes": {
                "resources": {"material_A": {"delta": 20, "mode": "percent"}}
            }
        },
        {
            "name": "Prod_1 profit +$10",
            "changes": {
                "products": {"prod_1": {"profit": {"delta": 10, "mode": "absolute"}}}
            }
        },
    ],
    report=True
)

Requirements

  • Python >= 3.8
  • scipy >= 1.7.0
  • numpy >= 1.21.0

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

factory_optimizer-1.0.1.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

factory_optimizer-1.0.1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file factory_optimizer-1.0.1.tar.gz.

File metadata

  • Download URL: factory_optimizer-1.0.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for factory_optimizer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3ccca02ecb2cdc64dfd51eb33bb50d5978066aa6bfb15d5215f6d48944023fd3
MD5 b31a0d4310864c7b04218c28532b0a4d
BLAKE2b-256 99846d9f64d010aa36751a5ae5442e8c82bbf4a49ef598f91f478ea7df430a1f

See more details on using hashes here.

File details

Details for the file factory_optimizer-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for factory_optimizer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2669aaafc7451ae86aabd6290e032806f8aecbdb595a0fa94a0285f71073af8d
MD5 3f46fc2c8f98bf82318f951117fe2ccf
BLAKE2b-256 c65412674b2c3261d1b6db22c6e36468383027a574ffb4afb52722ad45495471

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page