EventCollection(events: Iterable[maze.core.events.event_record.EventRecord] = ())¶
A collection of EventRecord instances that can be queried by event specification.
Append a new event record to the collection.
Extends self.events with a list of new event records.
query_events(event_spec: Union[Callable, Iterable[Callable]]) → Iterable¶
- Return all events collected at the current env step matching one or more given event types. The event
types are specified by the interface member function object itself.
Event calls are recorded as EventRecord, an object providing access to the passed arguments of the event method.
event_spec – Specifies the event type by the interface member function. Can either be a single event type specification or a list of specifications.
An iterable to the event objects.