smia.behaviours.init_aas_model_behaviour module¶
- class smia.behaviours.init_aas_model_behaviour.InitAASModelBehaviour(agent_object)[source]¶
Bases:
OneShotBehaviour- This class implements the behaviour responsible for reading the AAS model to obtain all submodels, submodel elements
and concept descriptions. The necessary checks are performed to ensure the valid initial conditions to start the running state of the DT. The AAS model is defined in the ConfigMap associated to the deployed container and in order to successfully read the definition in any serialization format (JSON or XML), BaSyx Python SDK will be used.
- async get_and_save_ontology_classes_information()[source]¶
- This method stores all the information related to the class elements defined in the ontology. Since the data is
- defined in the AAS model, it will be used to check whether the required data defined in the ontology has been
added in the AAS model. If the elements are valid, they will be created their associated ontology instance and the AAS SubmodelElement will be associated to these instances.
- async get_and_save_ontology_relationships_information()[source]¶
This method stores all the information related to the relationships between elements defined in the ontology. Since the data is defined in the AAS model, it will be used to check whether the linked elements have their associated ontology instance (created just before the execution of this method).
- async check_and_create_instances_by_iri(ontology_class_iri)[source]¶
This method checks the relationship between two elements and, if it is valid, it creates it (it connects the related ontology instances through the appropriate ObjectProperty).
- Parameters:
ontology_class_iri (str) – identifier in form of IRI for the element within the CSS ontology.
- async create_ontology_instance_from_sme_element(sme_elem, ontology_iri)[source]¶
This method creates the ontology instance from the AAS Submodel Element.
- Parameters:
sme_elem (basyx.aas.model.SubmodelElement) – SubmodelElement of the AAS model with all configured data.
ontology_iri (str) – IRI of the ontology class of the instance to be created.
- async static add_ontology_required_information(aas_model_elem, ontology_instance)[source]¶
This method adds the required information defined in the ontology to the given instance. All information is obtained from given the AAS Submodel Element.
- Parameters:
aas_model_elem (basyx.aas.model.SubmodelElement) – SubmodelElement of the AAS model with all configured data.
ontology_instance (ThingClass) – instance class on which the information will be added.
- async static convert_sme_class_to_extended_by_iri(sme_elem, ontology_iri)[source]¶
This method converts the class of a SubmodelElement to the Extended class, in order to add the required method to be used during the execution of the software. The extended class is obtained from from the CSS ontology utils
class using the IRI of the ontology class.
- Parameters:
sme_elem (basyx.aas.model.SubmodelElement) – SubmodelElement of the AAS model to be modified.
ontology_iri (iri) – ontology class IRI.
- async check_and_create_relationship_by_iri(relationship_iri)[source]¶
This method checks the relationship between two elements and, if it is valid, it creates it (it connects the related ontology instances through the appropriate ObjectProperty).
- Parameters:
relationship_iri (str) – identifier in form of IRI for the relationship within the CSS ontology.
- async check_and_create_operation_relationships()[source]¶
This method checks the relationship between OperationVariables and their related Operation SubmodelElement and, if they are included in the CSS ontology (by semanticIDs), the related ontology instances are linked through the appropriate ObjectProperty.
- async get_and_configure_asset_connections()[source]¶
This method gets all Asset Interfaces Descriptions in the AAS model, configures each case with associated ‘AssetConnection’ class and saves the information in the global variable of the agent for all asset connections.
- async print_analysis_result()[source]¶
This method simply prints the result of the complete analysis of the AAS model.
- async create_progress_bar_object()[source]¶
This method creates the object for showing by console the progress of the analysis of the AAS model in form of a progress bar. The object is