openg2g.events¶
openg2g.events
¶
Clock-aligned simulation event primitives.
SimEvent
dataclass
¶
Structured simulation event with canonical clock metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
tick |
int
|
Integer tick at which the event was emitted. |
t_s |
float
|
Simulation time in seconds. |
source |
EventSource
|
Component family that emitted the event. |
topic |
str
|
Dot-separated event topic string. |
data |
dict[str, Any]
|
Arbitrary key-value payload. |
Source code in openg2g/events.py
EventEmitter
dataclass
¶
Source-bound event helper that stamps SimEvent
instances with clock metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
clock |
SimulationClock
|
Simulation clock for timestamping events. |
log |
SimulationLog
|
|
source |
EventSource
|
Component family label attached to all events. |
Source code in openg2g/events.py
emit(topic, data=None)
¶
Emit one event with current clock metadata.