class NetworkManager:
    """NetworkManager class for managing network relationships between agents."""

    def __init__(self):
        """Initialize a NetworkManager."""
        self.edges = []

    def add_edge(self, edge_agent):
        """
        Add an edge to the network.

        Args:
            edge_agent: EdgeAgent representing a relationship
        """
        self.edges.append(edge_agent)

    def remove_edge(self, edge_agent):
        """
        Remove an edge from the network.

        Args:
            edge_agent: EdgeAgent to remove
        """
        if edge_agent in self.edges:
            self.edges.remove(edge_agent)

    def get_edges(self):
        """
        Get all edges in the network.

        Returns:
            List of EdgeAgents
        """
        return self.edges

    def get_neighbors(self, agent):
        """
        Get all agents connected to a given agent.

        Args:
            agent: Agent to find neighbors for

        Returns:
            List of agents connected to the given agent
        """
        neighbors = []
        for edge in self.edges:
            if edge.agent_1 == agent:
                neighbors.append(edge.agent_2)
            elif edge.agent_2 == agent:
                neighbors.append(edge.agent_1)
        return neighbors

    def __repr__(self):
        return f"NetworkManager(edges={len(self.edges)})"