Merge branch 'main' into ytli_update

This commit is contained in:
Xu Yang
2024-07-15 10:12:32 +00:00
4 changed files with 93 additions and 11 deletions
+9
View File
@@ -54,6 +54,15 @@ 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."""
# TODO: The return value does not align with the signature.
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):