Source code for tests.test_structural

"""
Author: Changbeom Choi (@cbchoi)
Copyright (c) 2014-2020 Handong Global University
Copyright (c) 2021-2024 Hanbat National University
License: MIT.  The full license text is available at:
https://github.com/eventsim/pyjevsim/blob/main/LICENSE
 
A 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 
"""
from pyjevsim.definition import *
from pyjevsim.definition import ExecutionType
from pyjevsim.system_executor import SysExecutor
from .model_stm import STM


[docs] def test_f(): se = SysExecutor(1, ex_mode=ExecutionType.V_TIME, snapshot_manager=None) #set Structural Model gen = STM("Gen") se.register_entity(gen) se.insert_input_port("start") #set Model Relation se.coupling_relation(None, "start", gen, "start") se.insert_external_event("start", None) se.simulate(5)