Interface AgentHierarchyManager.HierarchyContext

All Known Implementing Classes:
Agent, ConfigurableAgent
Enclosing class:
AgentHierarchyManager

public static interface AgentHierarchyManager.HierarchyContext
Interface for accessing Agent internals needed for hierarchy management. Implemented by Agent to provide controlled access to its state.
  • Method Details

    • getAgentId

      String getAgentId()
      Returns the agent's unique identifier.
    • getAgentRef

      Agent getAgentRef()
      Returns the agent reference itself.
    • getParentRef

      Agent getParentRef()
      Returns the current parent agent.
    • setParentRef

      void setParentRef(Agent parent)
      Sets the parent agent reference directly (no bidirectional updates).
    • getChildrenSnapshot

      List<Agent> getChildrenSnapshot()
      Returns an unmodifiable snapshot of the children list.
    • hasChild

      boolean hasChild(Agent child)
      Checks if the given agent is a child.
    • addChildDirect

      boolean addChildDirect(Agent child)
      Adds a child directly to the internal list.
      Returns:
      true if added, false if already present
    • removeChildDirect

      boolean removeChildDirect(Agent child)
      Removes a child directly from the internal list.
      Returns:
      true if removed, false if not present
    • findChildById

      Agent findChildById(String childId)
      Finds a child by ID.
      Returns:
      the child agent or null if not found
    • getCommunicationManager

      AgentCommunicationManager getCommunicationManager()
      Returns the communication manager for inter-agent messaging.