Shortcuts

Scheduling Problems

Flexible Flow Shop Problem (FFSP)

class rl4co.envs.ffsp.FFSPEnv(num_stage, num_machine, num_job, min_time=0.1, max_time=1.0, batch_size=[50], **kwargs)[source]

Bases: RL4COEnvBase

Flexible Flow Shop Problem (FFSP) environment. The goal is to schedule a set of jobs on a set of machines such that the makespan is minimized.

Parameters:
  • num_stage (int) – number of stages

  • num_machine (int) – number of machines in each stage

  • num_job (int) – number of jobs

  • min_time (float) – minimum processing time of a job

  • max_time (float) – maximum processing time of a job

  • batch_size (list) – batch size of the problem

Note

  • [IMPORTANT] This version of ffsp requires the number of machines in each stage to be the same

Initializes internal Module state, shared by both nn.Module and ScriptModule.

generate_data(batch_size)[source]

Dataset generation

Return type:

TensorDict

get_reward(td, actions)[source]

Function to compute the reward. Can be called by the agent to compute the reward of the current state This is faster than calling step() and getting the reward from the returned TensorDict at each time for CO tasks

Return type:

TensorDict

render(td)[source]

Render the environment

name = 'ffsp'