[docs]classStateBooting(State):""" This class contains the Boot state of the common AAS Manager. """
[docs]asyncdefrun(self):""" This method implements the boot state of the common AAS Manager. Here all the required initialization tasks are performed. """awaitself.booting_state_logic()self.set_next_state(AASmanagerInfo.RUNNING_STATE_NAME)
[docs]asyncdefbooting_state_logic(self):""" This method contains the logic of the boot state of the common AAS Manager. This method can be used by any inherited class. """_logger.info("## STATE 1: BOOTING ## (Initial state)")# First, the interactionId is resetself.agent.interaction_id=0# Then the AAS Archive is initialized. To do so, the associated behaviour is added to the agentinit_aas_archive_behav=InitAASarchiveBehaviour(self.agent)self.agent.add_behaviour(init_aas_archive_behav)# The submodels also have to be initalized, so its behaviour is also addedinit_submodels_behav=InitSubmodelsBehaviour(self.agent)self.agent.add_behaviour(init_submodels_behav)# Wait until the behaviours have finished because the AAS Archive has to be initialized to pass to running state.awaitinit_aas_archive_behav.join()awaitinit_submodels_behav.join()# If the initialization behaviour has completed, AAS Manager is in the InitializationReady statusAAS_Archive_utils.change_status('InitializationReady')# Wait until the AAS Core has initialized_logger.info('AAS Manager is waiting until its AAS Core has initialized.')check_core_initialization_behav=CheckCoreInitializationBehaviour(self.agent)self.agent.add_behaviour(check_core_initialization_behav)awaitcheck_core_initialization_behav.join()_logger.info('AAS Core has initialized.')# Finished the Boot State the agent can move to the next state_logger.info(f"{self.agent.jid} agent has finished it Boot state.")