def add_edge(self, agent_id1, agent_id2, edge_attr_dict=None, *edge_attrs):
if agent_id1 in self.global_topology.nodes(data=False):<EOL><INDENT>if agent_id2 in self.global_topology.nodes(data=False):<EOL><INDENT>self.global_topology.add_edge(agent_id1, agent_id2, edge_attr_dict=edge_attr_dict, *edge_attrs)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(agent_id2))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(agent_id1))<EOL><DEDENT>
Add an edge between agent_id1 and agent_id2. agent_id1 and agent_id2 correspond to Networkx node IDs.

This is a wrapper for the Networkx.Graph method `.add_edge`.

Agents agent_id1 and agent_id2 will be automatically added if they are not already present in the graph.
Edge attributes can be specified using keywords or passing a dictionary with key-value pairs

Parameters
----------
agent_id1, agent_id2 : nodes
    Nodes (as defined by Networkx) can be any hashable type except NoneType
edge_attr_dict : dictionary, optional (default = no attributes)
    Dictionary of edge attributes. Assigns values to specified keyword attributes and overwrites them if already
    present.
edge_attrs : keyword arguments, optional
    Edge attributes such as labels can be assigned directly using keyowrd arguments