Class GoalOrientedPlanner
java.lang.Object
dev.langchain4j.agentic.patterns.goap.GoalOrientedPlanner
- All Implemented Interfaces:
Planner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfirstAction(PlanningContext planningContext) voidinit(InitPlanningContext initPlanningContext) nextAction(PlanningContext planningContext) voidrestoreExecutionState(Map<String, Object> state) GoalOrientedPlanner does not persist execution state becausefirstAction(PlanningContext)recomputes the path from the current scope state via graph search.topology()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Planner
as, call, call, done, done, executionState, noOp, terminated
-
Constructor Details
-
GoalOrientedPlanner
public GoalOrientedPlanner()
-
-
Method Details
-
init
-
firstAction
- Specified by:
firstActionin interfacePlanner
-
nextAction
- Specified by:
nextActionin interfacePlanner
-
restoreExecutionState
GoalOrientedPlanner does not persist execution state becausefirstAction(PlanningContext)recomputes the path from the current scope state via graph search. On recovery, completed agents' outputs are already in scope, so the search produces a shorter path containing only the remaining agents. The cursor resets to 0 naturally, making state persistence unnecessary and potentially harmful (a stale cursor could point beyond the bounds of the recomputed path).- Specified by:
restoreExecutionStatein interfacePlanner- Parameters:
state- the previously saved execution state
-
topology
-