Skip to content

DisjunctiveGraphJspEnv not compatible with ray.rllib<2.40 because of use of signal.signal() #4

@nhuet

Description

@nhuet

When trying to train a ray.rllib algorithm on the jsp environment, this fails because of the handling of signals in graph_jsp_env.disjunctive_graph_jsp_visualizer.

Here is a minimal example which i expected to work as it is working with stablebaselines3:

import numpy as np
import ray
from graph_jsp_env.disjunctive_graph_jsp_env import DisjunctiveGraphJspEnv
from ray.rllib.algorithms import PPO
from ray.tune import register_env

jsp = np.array(
    [
        [
            [0, 1, 2],  # machines for job 0
            [0, 2, 1],  # machines for job 1
            [0, 1, 2],  # machines for job 2
        ],
        [
            [3, 2, 2],  # task durations of job 0
            [2, 1, 4],  # task durations of job 1
            [0, 4, 3],  # task durations of job 2
        ],
    ]
)

register_env(
    "jsp",
    lambda env_config: DisjunctiveGraphJspEnv(
        jps_instance=jsp,
    ),
)

ray.init()
algo = PPO(config=PPO.get_default_config().environment("jsp"))
algo.train()

Perhaps a solution could be to make the signals handling optional so that we can deactivate it when using ray.rllib.

NB: if we set ray in local mode (ray.init(local_mode=True)), it is working but the goal is to be able to use ray in standard mode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions