Skip to content

Commit

Permalink
Made corrections to starting node identification.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpaulius committed Dec 7, 2021
1 parent e7438d9 commit 67c47fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions FOON_scripts/FOON_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 67c47fd

Please sign in to comment.