Skip to main content

Python tool to simulate assembly lines.

Project description

LineFlow

PyPI

LineFLow is a python framework to simulate assembly lines. It allows to model arbitrary discrete part assembly lines and provides an gymnasium environment to optimize them with reinforcement learning. The documentation can be found here.

til

Install

Install with

pip install lineflow-rl

Examples

Visualization

This is how an assembly line can be implemented and visualized:

from lineflow.simulation import Line, Source, Sink, Process

class SimpleLine(Line):

    def build(self):

        # Set up stationary objects
        source = Source(
            name='Source',
            processing_time=5,
            position=(100, 500),
            unlimited_carriers=True,
        )

        process = Process('Process', processing_time=6, position=(350, 500))
        sink = Sink('Sink', processing_time=3, position=(600, 500))
        
        # Wire them with buffers
        source.connect_to_output(station=process, capacity=3)
        process.connect_to_output(station=sink, capacity=2)


line = SimpleLine()
line.run(simulation_end=500, visualize=True)

df = line.get_observations()

Training RL agents

This is how an RL agent can be trained using LineFlow:

from stable_baselines3 import PPO
from lineflow.simulation import LineSimulation

line = SimpleLine()
env = LineSimulation(line, simulation_end=100)
model = PPO("MlpPolicy", env)
model.learn(total_timesteps=100)

Docs

Serve the docs with

mkdocs serve

Paper

If you use our work in your research, please consider citing us with

@misc{LineFlow,
      title={LineFlow: A Framework to Learn Active Control of Production Lines}, 
      author={Kai Müller and Martin Wenzel and Tobias Windisch},
      year={2025},
      eprint={2505.06744},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2505.06744}, 
}

See this README for more details how to run the benchmarks.

Funding

The research behind LineFlow is funded by the Bavarian state ministry of research. Learn more here.

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

lineflow_rl-0.2.0.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

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

lineflow_rl-0.2.0-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file lineflow_rl-0.2.0.tar.gz.

File metadata

  • Download URL: lineflow_rl-0.2.0.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lineflow_rl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 30ad6cf6cfe299a3637d71033070583717382250b521c5983b4dca091b2b4d13
MD5 6de7c471c286e33694a97383930f3357
BLAKE2b-256 c83be547f86a90daa78499a706c480ac00e37a567ab993ccbcacd7879997e1aa

See more details on using hashes here.

File details

Details for the file lineflow_rl-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lineflow_rl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 46.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for lineflow_rl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e01865c306cabfc23e4d075ae19eeecf8b55a857035ad9f4f8627c7e9525d19
MD5 d9a8dddff2257a5cfdc1015865fcfd6e
BLAKE2b-256 b5f216e6bb2be88ce5ad302980ef21084415a0887446416ec16afebd3681e3a8

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