Metadata-Version: 2.5
Name: pirilib
Version: 0.2.0
Summary: Fleet optimization with an ant colony solver, a bee colony tuner and your own objective and constraints, starting with line-haul planning.
Project-URL: Homepage, https://github.com/mr-ozdemir/piriLIB
Project-URL: Documentation, https://github.com/mr-ozdemir/piriLIB/blob/master/docs/guide.md
Project-URL: Changelog, https://github.com/mr-ozdemir/piriLIB/blob/master/CHANGELOG.md
Project-URL: Issues, https://github.com/mr-ozdemir/piriLIB/issues
Author-email: Muhammet Ozdemir <mr.ozdemir34@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: ant colony optimization,artificial bee colony,demand forecasting,fleet optimization,line-haul,logistics,metaheuristics,vehicle routing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: numpy>=2.0
Requires-Dist: pydantic>=2.7
Requires-Dist: pyyaml>=6.0
Provides-Extra: exact
Requires-Dist: scipy>=1.14; extra == 'exact'
Provides-Extra: excel
Requires-Dist: openpyxl>=3.1; extra == 'excel'
Provides-Extra: forecast
Requires-Dist: lightgbm>=4.0; extra == 'forecast'
Requires-Dist: scikit-learn>=1.4; extra == 'forecast'
Provides-Extra: ortools
Requires-Dist: ortools>=9.15; extra == 'ortools'
Provides-Extra: pyvrp
Requires-Dist: pyvrp>=0.14; extra == 'pyvrp'
Description-Content-Type: text/markdown

# pirilib

Fleet optimization with an ant colony solver, a bee colony tuner and your own objective.

[![CI](https://github.com/mr-ozdemir/piriLIB/actions/workflows/ci.yml/badge.svg)](https://github.com/mr-ozdemir/piriLIB/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/pirilib?label=PyPI&cacheSeconds=3600)](https://pypi.org/project/pirilib/)
[![Python](https://img.shields.io/badge/python-3.12%20%7C%203.13%20%7C%203.14-blue)](https://github.com/mr-ozdemir/piriLIB/blob/master/pyproject.toml)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](https://github.com/mr-ozdemir/piriLIB/blob/master/LICENSE)

Describe the fleet, the demand and the rules in YAML, write what a good plan
means, and pirilib searches for the plan that serves the demand at the lowest
cost. One evaluator scores every plan the same way, whichever solver made it.

> **Alpha.** pirilib 0.1 is the first alpha; the API may change before 1.0.
> See [Public API and stability](https://github.com/mr-ozdemir/piriLIB/blob/master/docs/stability.md).

## Installation

```bash
pip install pirilib
```

pirilib needs Python 3.12+. Optional extras: `exact` (scipy), `excel`
(openpyxl), `forecast` (LightGBM, scikit-learn), `pyvrp` and `ortools`, for
example `pip install "pirilib[exact,excel]"`.

## Quick start

```pycon
>>> import pirilib
>>> spec = pirilib.load_spec("examples/linehaul_mini/problem.yaml")
>>> result = pirilib.solve(spec.compile(), spec.build_objective(), seed=1)
>>> result.evaluation
Evaluation(total_cost=178394.63, dispatches=18, total_km=2891.0, feasible)
```

Or from the command line:

```bash
pirilib generate sample --centers 20 --days 3
pirilib solve sample/problem.yaml -o plan.csv
pirilib check sample/problem.yaml plan.csv
```

## Features

- **Line-haul planning** with owned and spot vehicles, multi-stop routes, split
  loads, times and deferral, handling capacity and vehicle limits.
- **Ant colony solver** in numpy with local search, and an exact solver for
  small problems.
- **Your objective**: cost, distance and a penalty for every rule, in YAML or
  Python, with an independent plan checker.
- **Bee colony tuner** for the solver settings, validated on held-out problems.
- **Demand forecasting** per line, with backtests and a bridge from the
  forecast to a planning problem.
- **Clear errors**: every problem in a document is reported at once, with file
  and line for table rows.

## Documentation

- [User guide](https://github.com/mr-ozdemir/piriLIB/blob/master/docs/guide.md)
- [Building the objective](https://github.com/mr-ozdemir/piriLIB/blob/master/docs/objective.md)
- [Public API and stability](https://github.com/mr-ozdemir/piriLIB/blob/master/docs/stability.md)
- [Examples](https://github.com/mr-ozdemir/piriLIB/tree/master/examples)

## Contributing

See [CONTRIBUTING.md](https://github.com/mr-ozdemir/piriLIB/blob/master/CONTRIBUTING.md).

## License

Apache-2.0. Example data is synthetic; no third-party or competition data is
distributed.

## Türkçe

pirilib, filo optimizasyonu kütüphanesidir: problemi YAML ile tanımlarsınız,
ACO çözücü amaç fonksiyonunuza göre en iyi planı arar, ABC ayarlayıcı çözücü
ayarlarını bulur. CSV tabloları Türkçe biçimde (`;`, ondalık virgül, `gg.aa.yyyy`)
okunur ve yazılır, planlar Excel'e de yazılıp okunur.
