Skip to content

Commit

Permalink
Add score and noise to rl agent evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gistbatch committed Mar 26, 2024
1 parent b8fedf8 commit 5d3cf0f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/scheduling/learning/generate_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ def generate_rl_info_schedule(
circuits: list[QuantumCircuit | UserCircuit],
accelerators: list[Accelerator],
**kwargs,
) -> tuple[float, list[JobResultInfo]]:
) -> tuple[tuple[float, float, float], list[JobResultInfo]]:
"""Generates a schedule for the given jobs and accelerators using a rl agent.
Args:
circuits (list[QuantumCircuit | UserCircuit]): List of circuits (jobs) to schedule.
accelerators (list[Accelerator]): List of accelerators to schedule on.
Returns:
tuple[float, list[JobResultInfo]]: The list of jobs with their assigned machine and
the makespan of the schedule.
tuple[tuple[float, float, float] list[JobResultInfo]]:
The list of jobs with their assigned machine and
the makespan, score and noise of the schedule.
"""
setting = {"accelerators": accelerators, "circuits": circuits}
schedule = run_model(setting)
Expand All @@ -42,5 +43,5 @@ def generate_rl_info_schedule(
capacity=job.num_qubits,
)
)
evaluate_final_solution(schedule, accelerators, circuits)
return schedule.makespan, combined_jobs
result = evaluate_final_solution(schedule, accelerators, circuits)
return result, combined_jobs

0 comments on commit 5d3cf0f

Please sign in to comment.