Skip to content

Links

Get the agent linked to

Note

Dedicated link means there is only one thing linked to 1-1

Parameters:

Name Type Description Default
link str

The link name

required

Returns:

Name Type Description
agent

The single agent or None

get the object that have a link item with the given key

Parameters:

Name Type Description Default
key str

The key/name of the inventory item

required

Returns:

Name Type Description
set

set of ids

check if target and source are linked to for the given key

Parameters:

Name Type Description Default
link_source agent

The agent hosting the link

required
link_name str

The key/name of the inventory item

required

Returns:

Type Description

set | None: set of ids

create a link between agents

Parameters:

Name Type Description Default
set_holder agent | agent set

The host (set) of the link

required
link str

The link name

required
set_to agent|agent set

The items to link to

required

linked_to(link_source, link_name)

get the set that inventor the source is linked to for the given key

Parameters:

Name Type Description Default
link_source(id)

The id object to check

required
link_name str

The key/name of the inventory item

required
set | None

set of ids

required

Set the agent linked to

Note

Dedicated link means there is only one thing linked to 1-1

Parameters:

Name Type Description Default
link str

The link name

required
to agent

The single agent or None

required

removes the link between things

Parameters:

Name Type Description Default
set_holder agent|agent set

An agent or set of agents (ids or objects)

required
link str

Link name

required
set_to agent|agent set

The agents(s) to add a link to

required