"""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 StructuralModel object that allows you to implement the Discrete Event System Specification CoupledModel. """from.core_modelimportCoreModelfrom.definitionimportModelTypefrom.system_messageimportSysMessage
[docs]defcoupling_relation(self,src_obj,src_port,dst_obj,dst_port):src=(src_obj,src_port)dst=(dst_obj,dst_port)# If the source is not in the map, initialize it with an empty listifsrcnotinself.port_map:self.port_map[src]=[]# Add the destination to the source's list of destinationsself.port_map[src].append(dst)pass