Class NetworkMeshBuilder
java.lang.Object
com.tnsai.coordination.groups.network.NetworkMeshBuilder
Builder for creating NetworkMesh instances.
Usage Example
NetworkMesh mesh = NetworkMesh.builder()
.name("Agent Network")
.topology(Topology.FULL_MESH)
.add(agent1, agent2, agent3)
.autoStart(true)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionadd(com.tnsai.agents.Agent agent) Adds a member to the mesh.add(com.tnsai.agents.Agent... agents) Adds multiple members to the mesh.autoStart(boolean autoStart) Sets whether to auto-start after build.build()Builds the NetworkMesh.description(String description) Sets the mesh description.Sets the mesh ID.Sets the mesh name.policy(com.tnsai.agents.groups.GroupPolicy policy) Sets the group policy.Sets the network topology.
-
Method Details
-
id
Sets the mesh ID.- Parameters:
id- mesh ID- Returns:
- this builder
-
name
Sets the mesh name.- Parameters:
name- mesh name- Returns:
- this builder
-
description
Sets the mesh description.- Parameters:
description- mesh description- Returns:
- this builder
-
topology
Sets the network topology.- Parameters:
topology- topology type- Returns:
- this builder
-
policy
Sets the group policy.- Parameters:
policy- policy- Returns:
- this builder
-
add
Adds a member to the mesh.- Parameters:
agent- agent to add- Returns:
- this builder
-
add
Adds multiple members to the mesh.- Parameters:
agents- agents to add- Returns:
- this builder
-
autoStart
Sets whether to auto-start after build.- Parameters:
autoStart- auto-start flag- Returns:
- this builder
-
build
Builds the NetworkMesh.- Returns:
- new NetworkMesh instance
-