Class TeamBuilder
java.lang.Object
com.tnsai.coordination.groups.team.TeamBuilder
Builder for creating Team instances.
Usage Example
Team team = Team.builder()
.name("Analysis Team")
.mission("Analyze customer data")
.timeout(Duration.ofMinutes(30))
.formation(TeamFormation.PARALLEL)
.member(agent1, TeamRole.LEAD)
.member(agent2, TeamRole.MEMBER)
.autoStart(true)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionautoStart(boolean autoStart) Sets whether to auto-start after build.build()Builds the Team.description(String description) Sets the team description.formation(TeamFormation formation) Sets the team formation pattern.Sets the team ID.lead(com.tnsai.agents.Agent agent) Sets the team lead.member(com.tnsai.agents.Agent agent) Adds a member with default role (MEMBER).Adds a member with a specific role.Sets the mission description.Sets the team name.policy(com.tnsai.agents.groups.GroupPolicy policy) Sets the group policy.Sets the mission timeout.
-
Method Details
-
id
Sets the team ID.- Parameters:
id- team ID- Returns:
- this builder
-
name
Sets the team name.- Parameters:
name- team name- Returns:
- this builder
-
description
Sets the team description.- Parameters:
description- team description- Returns:
- this builder
-
mission
Sets the mission description.- Parameters:
mission- mission description- Returns:
- this builder
-
timeout
Sets the mission timeout.- Parameters:
timeout- timeout duration- Returns:
- this builder
-
formation
Sets the team formation pattern.- Parameters:
formation- formation- Returns:
- this builder
-
policy
Sets the group policy.- Parameters:
policy- policy- Returns:
- this builder
-
member
Adds a member with default role (MEMBER).- Parameters:
agent- agent to add- Returns:
- this builder
-
member
Adds a member with a specific role.- Parameters:
agent- agent to addrole- role to assign- Returns:
- this builder
-
lead
Sets the team lead.- Parameters:
agent- lead agent- Returns:
- this builder
-
autoStart
Sets whether to auto-start after build.- Parameters:
autoStart- auto-start flag- Returns:
- this builder
-
build
Builds the Team.- Returns:
- new Team instance
- Throws:
IllegalStateException- if mission not set
-