mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-29 08:27:43 +00:00
Updated Trace class
- Updated get_last_experiment_info(), a very useful function that returns the information of last experiment (to be used in feedback generation).
This commit is contained in:
@@ -54,6 +54,14 @@ class Trace(Generic[ASpecificScen]):
|
||||
self.scen: ASpecificScen = scen
|
||||
self.hist: list[Tuple[Hypothesis, Experiment, HypothesisFeedback]] = []
|
||||
|
||||
def get_last_experiment_info(self) -> Tuple[Hypothesis, ASpecificTask, Any]:
|
||||
"""Access the last experiment result, sub-task, and the corresponding hypothesis."""
|
||||
if not self.hist:
|
||||
return None
|
||||
last_hypothesis, last_experiment, _ = self.hist[-1]
|
||||
last_task = last_experiment.sub_tasks[-1]
|
||||
last_result = last_experiment.result
|
||||
return last_hypothesis, last_task, last_result
|
||||
|
||||
class HypothesisGen:
|
||||
def __init__(self, scen: Scenario):
|
||||
|
||||
Reference in New Issue
Block a user