smia.behaviours.specific_handle_behaviours.handle_capability_behaviour module¶
- class smia.behaviours.specific_handle_behaviours.handle_capability_behaviour.HandleCapabilityBehaviour(agent_object, svc_req_data)[source]¶
Bases:
OneShotBehaviourThis class implements the behaviour that handles a request related to the capabilities of the Digital Twin.
- async handle_query_if()[source]¶
This method handle Query-If requests for the Capability. This request is received when the DT is asked about information related to a capability.
- async handle_inform()[source]¶
This method handles AAS Services. These services serve for the management of asset-related information through a set of infrastructure services provided by the AAS itself. These include Submodel Registry Services (to list and register submodels), Meta-information Management Services (including Classification Services, to check if the interface complies with the specifications; Contextualization Services, to check if they belong together in a context to build a common function; and Restriction of Use Services, divided between access control and usage control) and Exposure and Discovery Services (to search for submodels or asset related services).
- async send_response_msg_to_sender(performative, service_params)[source]¶
This method creates and sends a FIPA-ACL message with the given serviceParams and performative.
- Parameters:
performative (str) – performative according to FIPA-ACL standard.
service_params (dict) – JSON with the serviceParams to be sent in the message.
- async check_received_capability_request_data()[source]¶
This method checks whether the data received contains the necessary information to be able to execute the capability. If an error occurs, it throws a CapabilityDataError exception.
- async check_received_skill_data(skill_elem)[source]¶
This method checks whether the data received contains the necessary information in relation to the skill of the received capability request.
- Parameters:
skill_elem (basyx.aas.model.SubmodelElement) – skill Python object in form of a SubmodelElement.
- Returns:
the result of the check.
- Return type:
bool
- async get_ontology_instances()[source]¶
This method gets the ontology instances for the capability, skill and skill interface depending on the received data. If the data is invalid or there are no available combination of three instances, it raises an Exception.
- Returns:
capability_instance (owlready2.ThingClass), skill_instance (owlready2.ThingClass), skill_interface_instance (owlready2.ThingClass): ontology instances for capability, skill and skill interface.
- async execute_capability_checking()[source]¶
This method executes the process of checking the requested capability to ensure that this SMIA can perform it.
- Returns:
result of the capability checking
- Return type:
bool
- async execute_capability(cap_instance, skill_instance, skill_interface_instance)[source]¶
This method executes a given capability through as an implementation of a given skill through a given skill interface. All the data received are instances of the CSS ontology.
- Parameters:
cap_instance (owlready2.ThingClass) – ontology instance of the capability to execute.
skill_instance (owlready2.ThingClass) – ontology instance of the skill to execute.
skill_interface_instance (owlready2.ThingClass) – ontology instance of the skill interface to use.
- Returns:
result of the capability execution
- Return type:
object