Behavior Executor¶
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
This module contains a BehaviorExecutor, an object for executing a BehaviorModel.
- class pyjevsim.behavior_executor.BehaviorExecutor(itime=inf, dtime=inf, ename='default', behavior_model=None, parent=None)[source]¶
Bases:
ExecutorA decorated form of the BehaviorModel, ready to be executed by the SysExecutor. Manages the simulation time of the BehaviorModel and the information in the SysExecutor.
- Parameters:
itime (int or Infinite) – Time of instance creation
dtime (int or Infinite) – Time of instance destruction
ename (str) – SysExecutor name
behavior_model (ModelType.BEHAVIORAL) – Behavior Model
Structural Executor¶
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
This module contains a StructuralExecutor, an object for executing a StructuralModel.
Snapshot Executor¶
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
This module contains an object SnapshotExecutor that decorates a BehaviorExecutor to snapshot a BehaviorModel.
- class pyjevsim.snapshot_executor.SnapshotExecutor(behavior_executor, condition, parent)[source]¶
Bases:
ExecutorSet the model you want to snapshot to a SnapshotExecutor in a form that can be executed by a SystemExecutor.
- ext_trans(port, msg)[source]¶
Handles the external transition.
- Parameters:
port (str) – The port name
msg (Message) – The message
- get_behavior_executor()[source]¶
Return BehaviorExecutor.
- Returns:
The behavior executor / 동작 실행기
- Return type:
- get_core_model()[source]¶
Returns BehaviorModel of SnapshotExecutor.
- Returns:
BehaviorModel
- Return type:
- get_create_time()[source]¶
Returns the creation time of SnapshotExecutor.
- Returns:
Creation time
- Return type:
float
- get_cur_state()[source]¶
Returns the current state of SnapshotExecutor.
- Returns:
Current state
- Return type:
str
- get_destruct_time()[source]¶
Returns the destruction time of SnapshotExecutor.
- Returns:
Destruction time
- Return type:
float
- get_engine_name()[source]¶
Returns SysExecutor name of SnapshotExecutor.
- Returns:
SysExecutor name
- Return type:
str
- init_state(state)[source]¶
Initializes the state of SnapshotExecutor.
- Parameters:
state (str) – The state to set / 설정할 상태
- output(msg_deliver)[source]¶
Handles the output function.
- Returns:
The output message
- Return type:
Message
- set_engine_name(engine_name)[source]¶
Sets SysExecutor name of SnapshotExecutor.
- Parameters:
engine_name (str) – SysExecutor name
- set_req_time(global_time)[source]¶
Sets the request time.
- Parameters:
global_time (float) – Simulation time
- snapshot(_prefix, _path='./snapshot')[source]¶
An abstract method that creates a method to take a snapshot. You can use the snapshot method in a conditional method. Use the model_dump method to get the model data in bytes. Save that data to the DB or save it to a file.
- Parameters:
name (str) – The name of the snapshot