"""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/LICENSEA simple GBP example using Structural Model. PEG(process event generator) model generates events periodically.Buffer model stores and forwards Events generated by the PEG.MsgRecv handles the event messages generated by the PEG.Usage:From a terminal in the parent directory, run the following command. pytest -s ./tests/test_hierachical.py """frompyjevsim.definitionimport*frompyjevsim.definitionimportExecutionTypefrompyjevsim.system_executorimportSysExecutorfrom.model_stmimportSTM
[docs]deftest_f():se=SysExecutor(1,ex_mode=ExecutionType.V_TIME,snapshot_manager=None)#set Structural Modelgen=STM("Gen")se.register_entity(gen)se.insert_input_port("start")#set Model Relationse.coupling_relation(None,"start",gen,"start")se.insert_external_event("start",None)se.simulate(5)