"""Author: Changbeom Choi (@cbchoi)Copyright (c) 2014-2020 Handong Global UniversityCopyright (c) 2021-2024 Hanbat National UniversityLicense: MIT. The full license text is available at:https://github.com/eventsim/pyjevsim/blob/main/LICENSEThis module contains a default model, DefaultMessageCatcher, for catching uncaught messages. """from.behavior_modelimportBehaviorModelfrom.definitionimport*
[docs]classDefaultMessageCatcher(BehaviorModel):""" A default model for catching uncaught messages. Receiving and not processing uncaught messages. """def__init__(self,_name):super().__init__(_name)self.init_state("IDLE")# Set initial state to 'IDLE'self.insert_state("IDLE",Infinite)# Insert 'IDLE' state with infinite durationself.insert_input_port("uncaught")# Insert 'uncaught' input port
[docs]defext_trans(self,port,msg):""" Received an uncaught message. Args: port (str): The port name msg (SysMessage): The incoming message """data=msg.retrieve()# Retrieve message