Class DefaultTeam
java.lang.Object
com.tnsai.coordination.groups.DefaultAgentGroup
com.tnsai.coordination.groups.team.DefaultTeam
- All Implemented Interfaces:
com.tnsai.agents.groups.AgentGroup,Team
Default implementation of Team.
Provides mission-oriented group execution with:
- Role-based member coordination
- Multiple formation patterns
- Mission progress tracking
- Automatic result aggregation
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTeam(String id, String name, String description, String mission, Duration timeout, TeamFormation formation, com.tnsai.agents.groups.GroupPolicy policy, Map<String, TeamRole> initialRoles) Creates a new DefaultTeam. -
Method Summary
Modifier and TypeMethodDescriptionvoidassignRole(String agentId, TeamRole role) Assigns a role to a team member.voiddisband()Disbands the team after mission completion.Executes a task using the team's formation pattern.Executes a task with custom context.executeAsync(String task) Executes a task asynchronously.executeAsync(String task, Map<String, Object> context) Executes a task asynchronously with context.Returns the team formation pattern.List<com.tnsai.agents.Agent> getMembersWithRole(TeamRole role) Gets all members with a specific role.Returns the mission description.Returns the mission tracker for progress monitoring.Gets the role of a team member.Returns the mission timeout.booleanChecks if the team is disbanded.booleanChecks if the team has completed its mission.toString()Methods inherited from class com.tnsai.coordination.groups.DefaultAgentGroup
addLifecycleListener, addMember, addMembershipListener, assignTask, broadcast, dissolve, electLeader, electLeader, findMembers, getDescription, getEventBus, getId, getLeader, getLifecycle, getMember, getMembers, getMembershipManager, getMetrics, getName, getPolicy, hasMember, notifyTaskComplete, notifyTaskFailed, removeLifecycleListener, removeMember, removeMembershipListener, scatter, scatter, scatterAsync, setPolicy, start, stop, stopNowMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.tnsai.agents.groups.AgentGroup
addLifecycleListener, addMember, addMembershipListener, assignTask, broadcast, broadcast, dissolve, electLeader, electLeader, findMembers, getDescription, getEventBus, getId, getLeader, getLifecycle, getMember, getMemberCount, getMembers, getMembershipManager, getMetrics, getName, getPolicy, hasMember, isActive, isDissolved, removeLifecycleListener, removeMember, removeMembershipListener, scatter, scatter, scatterAsync, setPolicy, start, stop, stopNow
-
Constructor Details
-
DefaultTeam
public DefaultTeam(String id, String name, String description, String mission, Duration timeout, TeamFormation formation, com.tnsai.agents.groups.GroupPolicy policy, Map<String, TeamRole> initialRoles) Creates a new DefaultTeam.- Parameters:
id- team IDname- team namedescription- team descriptionmission- mission descriptiontimeout- mission timeoutformation- execution formationpolicy- group policyinitialRoles- initial role assignments
-
-
Method Details
-
getMission
Description copied from interface:TeamReturns the mission description.- Specified by:
getMissionin interfaceTeam- Returns:
- mission description
-
getTimeout
Description copied from interface:TeamReturns the mission timeout.- Specified by:
getTimeoutin interfaceTeam- Returns:
- timeout duration
-
getFormation
Description copied from interface:TeamReturns the team formation pattern.- Specified by:
getFormationin interfaceTeam- Returns:
- formation
-
getMissionTracker
Description copied from interface:TeamReturns the mission tracker for progress monitoring.- Specified by:
getMissionTrackerin interfaceTeam- Returns:
- mission tracker
-
assignRole
Description copied from interface:TeamAssigns a role to a team member.- Specified by:
assignRolein interfaceTeam- Parameters:
agentId- agent IDrole- role to assign
-
getRole
Description copied from interface:TeamGets the role of a team member. -
getMembersWithRole
Description copied from interface:TeamGets all members with a specific role.- Specified by:
getMembersWithRolein interfaceTeam- Parameters:
role- role to find- Returns:
- members with that role
-
execute
Description copied from interface:TeamExecutes a task using the team's formation pattern. -
execute
Description copied from interface:TeamExecutes a task with custom context. -
executeAsync
Description copied from interface:TeamExecutes a task asynchronously.- Specified by:
executeAsyncin interfaceTeam- Parameters:
task- task to execute- Returns:
- future with result
-
executeAsync
Description copied from interface:TeamExecutes a task asynchronously with context.- Specified by:
executeAsyncin interfaceTeam- Parameters:
task- task to executecontext- additional context- Returns:
- future with result
-
disband
public void disband()Description copied from interface:TeamDisbands the team after mission completion. All members are removed and the team is dissolved. -
isMissionComplete
public boolean isMissionComplete()Description copied from interface:TeamChecks if the team has completed its mission.- Specified by:
isMissionCompletein interfaceTeam- Returns:
- true if mission complete
-
isDisbanded
public boolean isDisbanded()Description copied from interface:TeamChecks if the team is disbanded.- Specified by:
isDisbandedin interfaceTeam- Returns:
- true if disbanded
-
toString
- Overrides:
toStringin classDefaultAgentGroup
-