Class LoopPlanner

java.lang.Object
com.google.adk.planner.LoopPlanner
All Implemented Interfaces:
Planner

public final class LoopPlanner extends Object implements Planner
A planner that cycles through sub-agents repeatedly, stopping when an escalate event is detected or the maximum number of cycles is reached.
  • Constructor Details

    • LoopPlanner

      public LoopPlanner(int maxCycles)
  • Method Details

    • init

      public void init(PlanningContext context)
      Description copied from interface: Planner
      Initialize the planner with context and available agents. Called once before the planning loop starts.

      Default implementation is a no-op. Override to perform setup like building dependency graphs.

      Specified by:
      init in interface Planner
    • firstAction

      public io.reactivex.rxjava3.core.Single<PlannerAction> firstAction(PlanningContext context)
      Description copied from interface: Planner
      Select the first action to execute.
      Specified by:
      firstAction in interface Planner
    • nextAction

      public io.reactivex.rxjava3.core.Single<PlannerAction> nextAction(PlanningContext context)
      Description copied from interface: Planner
      Select the next action based on updated state and events.
      Specified by:
      nextAction in interface Planner