Skip to main content

DOI Python Badge PyPI version License


Job Shop Scheduling Problem Visualisations

About The Project

Ths project provides visualisation for the Job Shop Scheduling Problem (JSP). This is focused on Gantt charts. The input date for the visualisation is inspired by plotly's Gantt chart api. jsp-vis is a standalone package and in designed to be used in combination with a JSP-reinforcement learning environments that follow the Gymnasium Environment standard. The render function of the environment can be used to render the Gantt chart. Typically the render function can implement different modes like human, rgb_array or ansi rendering. The jsp-vis package offers three different visualisations: console visualisation, rgb_array visualisation and window visualisation. The window visualisation is essentially only rendering the rgb_array visualisation in a window using OpenCV. The console visualisation might be used for the asni mode of a render function, the rgb_array visualisation for the rgb_array mode and the window visualisation for the human mode.

Installation

Install the package with pip:

   pip install jsp-vis

Minimal Working Example: console visualisation

from jsp_vis.console import gantt_chart_console
import pandas as pd

df = pd.DataFrame([
   {'Task': 'Job 0', 'Start': 5, 'Finish': 16, 'Resource': 'Machine 0'},
   {'Task': 'Job 0', 'Start': 28, 'Finish': 31, 'Resource': 'Machine 1'},
   {'Task': 'Job 0', 'Start': 31, 'Finish': 34, 'Resource': 'Machine 2'},
   {'Task': 'Job 0', 'Start': 34, 'Finish': 46, 'Resource': 'Machine 3'},
   {'Task': 'Job 1', 'Start': 0, 'Finish': 5, 'Resource': 'Machine 0'},
   {'Task': 'Job 1', 'Start': 5, 'Finish': 21, 'Resource': 'Machine 2'},
   {'Task': 'Job 1', 'Start': 21, 'Finish': 28, 'Resource': 'Machine 1'},
   {'Task': 'Job 1', 'Start': 28, 'Finish': 32, 'Resource': 'Machine 3'}
])
num_of_machines = 4

gantt_chart_console(df, num_of_machines)

The code above will render the following Gantt chart in the console:

Minimal Working Example: console visualisation

from jsp_vis.cv2_window import render_gantt_in_window
import pandas as pd

df = pd.DataFrame([
   {'Task': 'Job 0', 'Start': 5, 'Finish': 16, 'Resource': 'Machine 0'},
   {'Task': 'Job 0', 'Start': 28, 'Finish': 31, 'Resource': 'Machine 1'},
   {'Task': 'Job 0', 'Start': 31, 'Finish': 34, 'Resource': 'Machine 2'},
   {'Task': 'Job 0', 'Start': 34, 'Finish': 46, 'Resource': 'Machine 3'},
   {'Task': 'Job 1', 'Start': 0, 'Finish': 5, 'Resource': 'Machine 0'},
   {'Task': 'Job 1', 'Start': 5, 'Finish': 21, 'Resource': 'Machine 2'},
   {'Task': 'Job 1', 'Start': 21, 'Finish': 28, 'Resource': 'Machine 1'},
   {'Task': 'Job 1', 'Start': 28, 'Finish': 32, 'Resource': 'Machine 3'}
])
num_of_machines = 4

render_gantt_in_window(
        df=df,
        n_machines=num_of_machines,
        wait=2000 # time in ms that the `cv2`-window is open.
        # wait=None # ''None'' will keep the window open till a keyboard occurs.
    )

The code above will render the following Gantt chart in the console:

More Examples

For more examples you can have a look at the test files in the tests directory. Every visualisation has its own test file and is tested on two different jsp instances defined in the conftest.py.

License

Distributed under the MIT License. See LICENSE.txt for more information.

Metadata

Release files for jsp-vis 1.3.0

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

Source distribution (sdist)

Source distribution for jsp-vis 1.3.0
File Size Uploaded Provenance Actions
jsp_vis-1.3.0.tar.gz 12.6 kB Without provenance Details for jsp_vis-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jsp-vis 1.3.0
File Interpreter ABI Platform Actions
jsp_vis-1.3.0-py3-none-any.whl Python 3 none any Details for jsp_vis-1.3.0-py3-none-any.whl

Total release size: 23.4 kB

Release files / jsp_vis-1.3.0.tar.gz

Download URL jsp_vis-1.3.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4dffb66bef772fd9448040c876303595895e4963f21a7f4229f9dbcda78da309
BLAKE2b-256 checksum
How to use checksums
b00612354c08ac5768b3ac1e45b129efd29f36c47314835b7a2adb5ff2c37a2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Release files / jsp_vis-1.3.0-py3-none-any.whl

Download URL jsp_vis-1.3.0-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e291f44b958de0918a2d10e731cbfa01036368223b5b9e1b8fb8e3d2b4e7100
BLAKE2b-256 checksum
How to use checksums
14b56e3e51e3477fca6449e9513d74012062c103fcb66877d68c1001a28bf75f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.14

Security for jsp-vis 1.3.0

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.

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