[docs]classStateBooting(State):""" This class contains the Boot state of the common SMIA. """
[docs]asyncdefrun(self):""" This method implements the boot state of the common SMIA. Here all the required initialization tasks are performed. """awaitself.booting_state_logic()self.set_next_state(SMIAGeneralInfo.RUNNING_STATE_NAME)
[docs]asyncdefbooting_state_logic(self):""" This method contains the logic of the boot state of the common SMIA. This method can be used by any inherited class. """_logger.info("## STATE 1: BOOTING ## (Initial state)")# First, it is ensured that the attributes of the SMIA are initializedself.agent.initialize_smia_attributes()# The ontology has to be initialized in order to be available during the AAS model analysisawaitself.agent.css_ontology.initialize_ontology()# The submodels also have to be initialized, so its behaviour is also addedinit_aas_model_behav=InitAASModelBehaviour(self.agent)self.agent.add_behaviour(init_aas_model_behav)# Wait until the behaviours have finished because the AAS Archive has to be initialized to pass to running stateawaitinit_aas_model_behav.join()# If the initialization behaviour has completed, SMIA is in the InitializationReady statussmia_archive_utils.update_status('InitializationReady')# Finished the Boot State the agent can move to the next state_logger.info(f"{self.agent.jid} agent has finished it Boot state.")