<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_edge(self, agent_id1, agent_id2, edge_attr_dict=None, *edge_attrs):
 """ 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 """

        if agent_id1 in self.global_topology.nodes(data=False):
            if agent_id2 in self.global_topology.nodes(data=False):
                self.global_topology.add_edge(agent_id1, agent_id2, edge_attr_dict=edge_attr_dict, *edge_attrs)
            else:
                raise ValueError('\'agent_id2\'[{}] not in list of existing agents in the network'.format(agent_id2))
        else:
            raise ValueError('\'agent_id1\'[{}] not in list of existing agents in the network'.format(agent_id1))