diff --git a/predicators/approaches/maple_q_approach.py b/predicators/approaches/maple_q_approach.py index eafb7e197f..dd2d1fb9bb 100644 --- a/predicators/approaches/maple_q_approach.py +++ b/predicators/approaches/maple_q_approach.py @@ -176,7 +176,7 @@ def _learn_nsrts(self, trajectories: List[LowLevelTrajectory], if (online_learning_cycle is None or len( self._q_function._ordered_ground_nsrts) + len( # pylint: disable=protected-access self._q_function._ordered_frozen_goals) + len( # pylint: disable=protected-access - self._q_function._ordered_objects) == 0) and + self._q_function._ordered_objects) == 0) and \ CFG.approach != "rl_bridge_policy": # pylint: disable=protected-access all_ground_nsrts: Set[_GroundNSRT] = set() if CFG.sesame_grounder == "naive": diff --git a/predicators/structs.py b/predicators/structs.py index e53f1efe38..1ad0c05b2c 100644 --- a/predicators/structs.py +++ b/predicators/structs.py @@ -182,9 +182,11 @@ def allclose(self, other: State) -> bool: objects are the same, and the features are close.""" if self.simulator_state is not None or \ other.simulator_state is not None: - if not CFG.allow_state_allclose_comparison_despite_simulator_state: + if not CFG.allow_state_allclose_comparison_despite_simulator_state: raise NotImplementedError("Cannot use allclose when " "simulator_state is not None.") + if self.simulator_state != other.simulator_state: + return False return self._allclose(other) def _allclose(self, other: State) -> bool: