aea.registries.resources
This module contains the resources class.
Resources Objects
class Resources()
This class implements the object that holds the resources of an AEA.
__
init__
| __init__(agent_name: str = "standalone") -> None
Instantiate the resources.
:return None
agent_
name
| @property
| agent_name() -> str
Get the agent name.
component_
registry
| @property
| component_registry() -> AgentComponentRegistry
Get the agent component registry.
behaviour_
registry
| @property
| behaviour_registry() -> ComponentRegistry[Behaviour]
Get the behaviour registry.
handler_
registry
| @property
| handler_registry() -> HandlerRegistry
Get the handler registry.
model_
registry
| @property
| model_registry() -> ComponentRegistry[Model]
Get the model registry.
add_
component
| add_component(component: Component)
Add a component to resources.
add_
protocol
| add_protocol(protocol: Protocol) -> None
Add a protocol to the set of resources.
Arguments:
protocol
: a protocol
Returns:
None
get_
protocol
| get_protocol(protocol_id: PublicId) -> Optional[Protocol]
Get protocol for given protocol id.
Arguments:
protocol_id
: the protocol id
Returns:
a matching protocol, if present, else None
get_
all_
protocols
| get_all_protocols() -> List[Protocol]
Get the list of all the protocols.
Returns:
the list of protocols.
remove_
protocol
| remove_protocol(protocol_id: PublicId) -> None
Remove a protocol from the set of resources.
Arguments:
protocol_id
: the protocol id for the protocol to be removed.
Returns:
None
add_
contract
| add_contract(contract: Contract) -> None
Add a contract to the set of resources.
Arguments:
contract
: a contract
Returns:
None
get_
contract
| get_contract(contract_id: PublicId) -> Optional[Contract]
Get contract for given contract id.
Arguments:
contract_id
: the contract id
Returns:
a matching contract, if present, else None
get_
all_
contracts
| get_all_contracts() -> List[Contract]
Get the list of all the contracts.
Returns:
the list of contracts.
remove_
contract
| remove_contract(contract_id: PublicId) -> None
Remove a contract from the set of resources.
Arguments:
contract_id
: the contract id for the contract to be removed.
Returns:
None
add_
connection
| add_connection(connection: Connection) -> None
Add a connection to the set of resources.
Arguments:
connection
: a connection
Returns:
None
get_
connection
| get_connection(connection_id: PublicId) -> Optional[Connection]
Get connection for given connection id.
Arguments:
connection_id
: the connection id
Returns:
a matching connection, if present, else None
get_
all_
connections
| get_all_connections() -> List[Connection]
Get the list of all the connections.
Returns:
the list of connections.
remove_
connection
| remove_connection(connection_id: PublicId) -> None
Remove a connection from the set of resources.
Arguments:
connection_id
: the connection id for the connection to be removed.
Returns:
None
add_
skill
| add_skill(skill: Skill) -> None
Add a skill to the set of resources.
Arguments:
skill
: a skill
Returns:
None
get_
skill
| get_skill(skill_id: PublicId) -> Optional[Skill]
Get the skill for a given skill id.
Arguments:
skill_id
: the skill id
Returns:
a matching skill, if present, else None
get_
all_
skills
| get_all_skills() -> List[Skill]
Get the list of all the skills.
Returns:
the list of skills.
remove_
skill
| remove_skill(skill_id: PublicId) -> None
Remove a skill from the set of resources.
Arguments:
skill_id
: the skill id for the skill to be removed.
Returns:
None
get_
handler
| get_handler(protocol_id: PublicId, skill_id: PublicId) -> Optional[Handler]
Get a specific handler.
Arguments:
protocol_id
: the protocol id the handler is handlingskill_id
: the skill id of the handler's skill
Returns:
the handler
get_
handlers
| get_handlers(protocol_id: PublicId) -> List[Handler]
Get all handlers for a given protocol.
Arguments:
protocol_id
: the protocol id the handler is handling
Returns:
the list of handlers matching the protocol
get_
all_
handlers
| get_all_handlers() -> List[Handler]
Get all handlers from all skills.
Returns:
the list of handlers
get_
behaviour
| get_behaviour(skill_id: PublicId, behaviour_name: str) -> Optional[Behaviour]
Get a specific behaviours for a given skill.
Arguments:
skill_id
: the skill idbehaviour_name
: the behaviour name
Returns:
the behaviour, if it is present, else None
get_
behaviours
| get_behaviours(skill_id: PublicId) -> List[Behaviour]
Get all behaviours for a given skill.
Arguments:
skill_id
: the skill id
Returns:
the list of behaviours of the skill
get_
all_
behaviours
| get_all_behaviours() -> List[Behaviour]
Get all behaviours from all skills.
Returns:
the list of all behaviours
setup
| setup() -> None
Set up the resources.
Calls setup on all resources.
Returns:
None
teardown
| teardown() -> None
Teardown the resources.
Calls teardown on all resources.
Returns:
None