Package com.tnsai.coordination.planning
Interface GroupPlanner
- All Known Implementing Classes:
DefaultGroupPlanner
public interface GroupPlanner
Decomposes a high-level goal across a group of agents.
GroupPlanner is responsible for splitting complex goals into
sub-goals that are assigned to individual agents based on their
capabilities. The decomposition produces a GoalDecomposition
containing both the sub-goal assignments and their dependency
ordering.
Usage
GroupPlanner planner = DefaultGroupPlanner.create();
GoalDecomposition decomposition = planner.decompose(
"build_shelter",
agents,
Map.of("hasMaterials", false, "hasBlueprint", false)
);
// Execute parallel sub-goals first, then sequential ones
for (SubGoal sub : decomposition.executionOrder()) {
Agent assignee = decomposition.getAssignee(sub);
assignee.planForGoal(sub.goalName());
}
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanDecompose(String goalName, List<com.tnsai.agents.Agent> agents) Checks whether this planner can decompose the given goal.Decomposes a high-level goal into sub-goals assigned to agents.
-
Method Details
-
decompose
GoalDecomposition decompose(String goalName, List<com.tnsai.agents.Agent> agents, Map<String, Object> state) Decomposes a high-level goal into sub-goals assigned to agents.- Parameters:
goalName- the goal to decomposeagents- available agents in the groupstate- current shared state (beliefs) of the group- Returns:
- decomposition with sub-goal assignments and ordering
- Throws:
IllegalArgumentException- if agents list is empty
-
canDecompose
Checks whether this planner can decompose the given goal.- Parameters:
goalName- the goal to checkagents- available agents- Returns:
- true if the goal can be decomposed across the agents
-