ciw.event_logger_from_ciw_recs
ciw.event_logger_from_ciw_recs(
ciw_recs_obj,
node_name_list,
*,
run_number=None,
scenario=None,
label=None,
)Build a vidigi EventLogger from a single ciw.data_record object.
Equivalent to :func:event_log_from_ciw_recs, but returns a populated :class:vidigi.logging.EventLogger rather than a bare DataFrame. Use this when you want the logger’s extras on top of the animation: event querying (get_events_by_entity, get_events_by_event_type, …), JSON / CSV export, plot_entity_timeline, and generate_dfg for a process map.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ciw_recs_obj | Iterable[CiwRecord] | An iterable ciw.data_record object, as output by Simulation.get_all_records(). See :func:event_log_from_ciw_recs. |
required |
| node_name_list | Sequence[str] | User-defined list of node names. See :func:event_log_from_ciw_recs. |
required |
| run_number | int | If given, stamped onto every logged event as run_number, so this logger’s events can be told apart from other runs’ - required if the logger is later added to a TrialLogger. Default None (no run_number column). |
None |
| scenario | object or dict | Parameters object / resource-count container to attach to the logger for provenance. See :class:vidigi.logging.EventLogger. |
None |
| label | str | Human-readable name to attach to the logger. | None |
Returns
| Name | Type | Description |
|---|---|---|
| vidigi.logging.EventLogger | A logger whose _log holds one record per event. logger.to_dataframe() carries the same data as :func:event_log_from_ciw_recs; the column order follows BaseEvent’s field order instead, which the animation and analysis functions (being column-name based) do not care about. |
See Also
event_log_from_ciw_recs : The bare-DataFrame version. trial_logger_from_ciw_recs : The multi-run version.
Examples
import ciw from vidigi.ciw import event_logger_from_ciw_recs
N = ciw.create_network( arrival_distributions=[ciw.dists.Exponential(rate=0.2)], service_distributions=[ciw.dists.Exponential(rate=0.1)], number_of_servers=[3] ) ciw.seed(1) Q = ciw.Simulation(N) Q.simulate_until_max_time(1440)
logger = event_logger_from_ciw_recs( Q.get_all_records(), node_name_list=[“bank_server”] ) logger.to_dataframe()