From 67c47fd6cec78453060d477442e6494463502ddc Mon Sep 17 00:00:00 2001 From: David Paulius Ramos Date: Tue, 7 Dec 2021 12:30:22 -0500 Subject: [PATCH] Made corrections to starting node identification. --- FOON_scripts/FOON_retrieval.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/FOON_scripts/FOON_retrieval.py b/FOON_scripts/FOON_retrieval.py index 299a914..b947273 100644 --- a/FOON_scripts/FOON_retrieval.py +++ b/FOON_scripts/FOON_retrieval.py @@ -318,7 +318,7 @@ def _loadKitchenList(file='FOON-input_only_nodes.txt'): return kitchen #enddef -def _isStartingNode(O): +def _isStartingNode(O, ): # NOTE: simple function to evaluate whether a certain node is a starting node: # -- one surefire way: check the output node to functional unit map; @@ -327,6 +327,10 @@ def _isStartingNode(O): if not procedures: return True + return False + + +def _isBaseState(O): # -- another possibility: what if this node has starting node states? # (e.g. 'empty', 'off', 'clean') count_initial_states = 0 @@ -1733,7 +1737,7 @@ def _findAllPaths(goalType, goalState, hierarchy_level=3, check_ingredients=True for _input in precondition_unit.getInputList(): # -- check if this node is considered to be a starting node: - if _isStartingNode(_input): + if _isStartingNode(_input) or _isBaseState(_input): if verbose: _input.print_functions[2]() continue