diff --git a/predicators/approaches/active_sampler_learning_approach.py b/predicators/approaches/active_sampler_learning_approach.py index 4de4eb8511..3ada097f1e 100644 --- a/predicators/approaches/active_sampler_learning_approach.py +++ b/predicators/approaches/active_sampler_learning_approach.py @@ -104,7 +104,11 @@ def _create_explorer(self) -> BaseExplorer: preds = self._get_current_predicates() # Pursue the task goal during exploration periodically. n = CFG.active_sampler_learning_explore_pursue_goal_interval - pursue_task_goal_first = (self._online_learning_cycle % n == 0) + pursue_task_goal_first = False + if self._online_learning_cycle < \ + CFG.active_sampler_learning_init_cycles_to_pursue_goal or ( + self._online_learning_cycle % n == 0): + pursue_task_goal_first = True explorer = create_explorer( CFG.explorer, preds, diff --git a/predicators/settings.py b/predicators/settings.py index b3fe92e663..f91edc4bfe 100644 --- a/predicators/settings.py +++ b/predicators/settings.py @@ -602,6 +602,7 @@ class GlobalSettings: active_sampler_explorer_replan_frequency = 100 active_sampler_explorer_planning_progress_max_tasks = 10 active_sampler_explorer_planning_progress_max_replan_tasks = 5 + active_sampler_learning_init_cycles_to_pursue_goal = 1 # grammar search invention parameters grammar_search_grammar_includes_givens = True