delete_edge_to()

Deletes the edge connecting this agent to a given agent, or from this agent to a list of agents, within a given network.

Synopsis

delete_edge_to(network, agent)

delete_edge_to(network, agent-list)

Description

If an edge exists in the given network from the current agent to a given agent ID, then the edge is deleted. Otherwise, the action has no effect. If the second argument is a list expression, then edges from the current agent to each agent in the list are deleted.

For undirected networks, because direction does not matter, both delete_edge_from() and delete_edge_to() have the same effect of deleting an undirected edge between the current and other agents.

Parameters

network

The name of the network to manipulate.

agent

An expression that evaluates to the ID of an agent.

agent-list

A list of agent ids.

Examples

If there is a directed network named NETWORK with three agents, agent1 agent2 and agent3, with agent ids, id1 id2 and id3 respectively, connected with an edge from agent1 to agent2 and another edge from agent1 to agent3, then the edge from agent1 to agent2 can be deleted with the following action rule:

if (id == id1) then delete_edge_to(NETWORK, id2)

In the same scenario described above, both connections can be deleted with the action rule:

if (id == id1) then delete_edge_to(NETWORK, list(id2,id3))

See Also

add_edge_from(), add_edge_to(), delete_edge_from(), is_connected_from(), is_connected_to()