Class AStarSearchStrategy

java.lang.Object
com.google.adk.planner.goap.AStarSearchStrategy
All Implemented Interfaces:
SearchStrategy

public final class AStarSearchStrategy extends Object implements SearchStrategy
A* forward search strategy that explores from preconditions toward the goal, activating agents whose inputs are all satisfied.

Uses a priority queue ordered by f-score (g + h) where:

  • g = number of agents activated so far (uniform cost)
  • h = admissible heuristic counting unsatisfied dependencies reachable backward from goal

After finding the goal, reconstructs the agent path and delegates to DependencyGraphSearch.assignParallelLevels(ImmutableList, List, Collection, GoalOrientedSearchGraph) for parallel grouping.

  • Constructor Details

    • AStarSearchStrategy

      public AStarSearchStrategy()
  • Method Details

    • searchGrouped

      public com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<String>> searchGrouped(GoalOrientedSearchGraph graph, List<AgentMetadata> metadata, Collection<String> preconditions, String goal)
      Description copied from interface: SearchStrategy
      Searches for agent execution groups that produce the goal.
      Specified by:
      searchGrouped in interface SearchStrategy
      Parameters:
      graph - the dependency graph
      metadata - agent metadata
      preconditions - state keys already available
      goal - the target output key
      Returns:
      ordered list of agent groups for parallel execution