Visualization

dsbx.Vis

Visualization utilities for DynaSchedBench trajectories and metrics.

This package provides a small set of plotting helpers:

  • Gantt charts from a Trajectory

  • Metric curves from metrics JSON or trajectory objects

The goal is to offer good defaults while keeping the API simple and script-friendly.

dsbx.Vis.plot_gantt_from_trajectory(traj, *, out_path=None, figsize=(10.0, 6.0), dpi=300, time_window=None, label_mode='op', x_grid_step=None)

Plot a simple Gantt chart from a trajectory.

Uses the final snapshot’s machine schedule segments. If time_window is provided, only segments intersecting that window are drawn, and both bars and labels are clipped to the window.

Parameters:
  • traj (Trajectory)

  • out_path (Path | None)

  • figsize (Tuple[float, float])

  • dpi (int)

  • time_window (Tuple[float, float] | None)

  • label_mode (str)

  • x_grid_step (float | None)

dsbx.Vis.plot_job_gantt_from_trajectory(traj, *, out_path=None, figsize=(10.0, 6.0), dpi=150, time_window=None, x_grid_step=None, legend_loc='upper right')

Plot a job-centric Gantt chart from a trajectory.

Unlike the machine-centric Gantt chart, each row represents one job. The x-axis is time, each bar is one processing interval for that job, and colors distinguish machine groups.

Parameters:
  • traj (Trajectory)

  • out_path (Path | None)

  • figsize (Tuple[float, float])

  • dpi (int)

  • time_window (Tuple[float, float] | None)

  • x_grid_step (float | None)

  • legend_loc (str)

dsbx.Vis.plot_metric_over_time(traj, metric, *, out_path=None, figsize=(8.0, 4.0), dpi=150, start_time=0.0)

Plot a metric curve as a function of time based on a trajectory.

Supported metric values include: - “wip”: work-in-process count - “utilization_global”: average machine utilization - “queue_length_total”: total queue length across all machines - “jobs_completed”: cumulative number of completed jobs

Parameters:
  • traj (Trajectory)

  • metric (str)

  • out_path (Path | None)

  • figsize (Tuple[float, float])

  • dpi (int)

  • start_time (float)