The Agent-Task Graph representationΒΆ
[1]:
from job_shop_lib import JobShopInstance, Operation
from job_shop_lib.graphs import (
build_complete_agent_task_graph,
build_agent_task_graph_with_jobs,
build_agent_task_graph,
)
from job_shop_lib.visualization import plot_agent_task_graph
CPU = 0
GPU = 1
DATA_CENTER = 2
job_1 = [Operation(CPU, 1), Operation(GPU, 1), Operation(DATA_CENTER, 7)]
job_2 = [Operation(GPU, 5), Operation(DATA_CENTER, 1), Operation(CPU, 1)]
job_3 = [Operation(DATA_CENTER, 1), Operation(CPU, 3), Operation(GPU, 2)]
jobs = [job_1, job_2, job_3]
instance = JobShopInstance(jobs, name="Example")
[2]:
complete_graph = build_complete_agent_task_graph(instance)
with_jobs_graph = build_agent_task_graph_with_jobs(instance)
graph = build_agent_task_graph(instance)
[3]:
_ = plot_agent_task_graph(complete_graph, title="", figsize=(5, 7))

[4]:
_ = plot_agent_task_graph(with_jobs_graph, title="", figsize=(5, 7))

[5]:
_ = plot_agent_task_graph(graph, title="", figsize=(3, 5))

[ ]: