Creates a new Edge
object between the current agent and a new agent, for use in graphs and networks.
Parameters
partner — Agent, required
The agent to which the current agent should be connected.
kind — str, optional
The type of connection being made. Can be used to create multiple non-conflicting networks.
Default value: 'edge'
direction — int|bool|Agent, optional
- If an
int
,direction>0
signifies an outbound edge from the agent,direction<0
creates in inbound edge to the agent, anddirection==0
creates an undirected edge. - If a
bool
,True
creates an outbound link from the agent andFalse
creates an undirected link. - If an agent object, indicates which agent should be the endpoint, the other being the startpoint.
- If
None
, creates an undirected edge.
Default value: None
- If an
weight — num, optional
The weight of the connection.
Default value: 1
Return Value — Edge
The newly created Edge
object.
Notes and Examples