Interface MatrixOrganization
- All Superinterfaces:
com.tnsai.agents.groups.AgentGroup
- All Known Implementing Classes:
DefaultMatrixOrg
public interface MatrixOrganization
extends com.tnsai.agents.groups.AgentGroup
A matrix organization with dual-reporting structure.
MatrixOrganization extends AgentGroup with multi-dimensional agent assignments. Agents can belong to multiple dimensions (e.g., functional area + project team) with different leads in each.
Key Features
- Multi-dimensional: Agents belong to multiple dimensions
- Dual reporting: Different leads per dimension
- Cross-functional: Execute tasks within specific dimensions
- Flexible structure: Dynamic dimension assignment
Usage Example
MatrixOrganization matrix = MatrixOrganization.builder()
.name("Product Organization")
.member(dev1)
.member(dev2)
.member(engLead)
.assign(dev1, "Engineering", engLead)
.assign(dev1, "Project-X", pmLead)
.build();
matrix.start();
MatrixResult result = matrix.executeInDimension("Engineering", "Code review");
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignToDimension(String agentId, String dimension, String leadId) Assigns an agent to a dimension with an optional lead.static MatrixBuilderbuilder()Creates a new MatrixOrganization builder.executeInDimension(String dimension, String task) Executes a task within a specific dimension.getAgentDimensions(String agentId) Returns all dimensions an agent belongs to.Returns the cross-functional manager.List<com.tnsai.agents.Agent> getDimensionMembers(String dimension) Returns all members of a dimension.Returns all known dimensions.Methods 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
-
Method Details
-
assignToDimension
Assigns an agent to a dimension with an optional lead.- Parameters:
agentId- agent to assigndimension- dimension nameleadId- dimension lead agent ID (may be null)- Throws:
IllegalArgumentException- if agent is not a member
-
getDimensionMembers
Returns all members of a dimension.- Parameters:
dimension- dimension name- Returns:
- list of agents in the dimension
-
getAgentDimensions
Returns all dimensions an agent belongs to.- Parameters:
agentId- agent ID- Returns:
- set of dimension names
-
getDimensions
Returns all known dimensions.- Returns:
- set of dimension names
-
executeInDimension
Executes a task within a specific dimension. Only members of that dimension participate.- Parameters:
dimension- dimension nametask- task to execute- Returns:
- execution result
-
getCrossFunctional
CrossFunctional getCrossFunctional()Returns the cross-functional manager.- Returns:
- cross-functional manager
-
builder
Creates a new MatrixOrganization builder.- Returns:
- builder
-