4 releases
Uses new Rust 2024
new 0.0.3-rc1 | Apr 17, 2025 |
---|---|
0.0.2 | Apr 17, 2025 |
0.0.1 | Apr 16, 2025 |
#464 in Algorithms
377 downloads per month
17KB
Balance Engine
A Python/Rust module for production planning and optimization using linear programming.
Balance Engine automates calculations to balance production with demand, allowing for precise and efficient planning while reducing costs. It uses linear programming modeling to optimize resource allocation in limited production cycles.
The tool handles key production variables including:
- Yielded Supply
- On Hand (Finished Goods)
- Safety Stock Targets
- Sellable Supply
- Effective Demand
- Total Projected Inventory Balance
Installation
Python Package
pip install balance-engine
Rust Crate
cargo add balance_engine
Features
- Hybrid Architecture: Core optimization in Rust for performance, Python API for flexibility
- Production Planning: Balance supply with demand while respecting capacity constraints
- Inventory Management: Calculate optimal inventory levels that meet safety stock requirements
- Resource Allocation: Efficiently allocate limited resources in production cycles
Project Structure
- Rust Core: High-performance linear programming solver
- Python Interface: Easy-to-use API for integration with data analysis workflows
- Example Code: Sample implementations for common production planning scenarios
Usage
import engine
# Initialize the engine
engine.init()
# Use the optimization functions
result = engine.optimize_production_plan(
products=["ProductA", "ProductB"],
demand_dict={"ProductA": 100, "ProductB": 150},
production_rates_dict={"ProductA": 10, "ProductB": 15},
available_hours=20,
current_inventory_dict={"ProductA": 20, "ProductB": 10},
min_inventory_dict={"ProductA": 10, "ProductB": 20}
)
print(result)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
~5MB
~102K SLoC