Function reference

All-In-One Animation Functions

animation.animate_activity_log Generate an animated visualization of patient flow through a system.

Step-By-Step Functions

prep.reshape_for_animations Reshape event log data for animation purposes.
prep.generate_animation_df Generate a DataFrame for animation purposes by adding position information to entity data.
animation.generate_animation Generate an animated visualization of patient flow through a system.

Animation Enhancers

animation.add_repeating_overlay Add a repeating overlay (rectangle and text) to an animated Plotly figure
animation.add_subplot_panels Re-home a vidigi animation into the top row of a stacked subplot grid.
animation.add_synchronised_trace Add extra traces to an animation, kept in step with its frames.
animation.add_synchronised_trace_from_dataframe Add a synchronised trace built from a long-form DataFrame.

Simpy Resource Classes

resources.VidigiResource A simple resource class with an ID attribute for use in VidigiStore and VidigiPriorityStore.
resources.VidigiStore A wrapper around SimPy’s Store that allows using a context manager pattern
resources.VidigiPriorityStore An optimized SimPy priority store that eliminates delays between resource
resources.populate_store Populate a SimPy Store (or VidigiPriorityStore) with VidigiResource objects.

Event Logging Utility Functions and Classes

logging.EventLogger Records simulation events for later reshaping into animations and statistics.
logging.TrialLogger A container and analysis utility for managing multiple event logs from repeated

Analysis Functions

Numbers-in, DataFrames-out - the compute twin behind every function in Analysis Plots below.

analysis.event_durations Pair occurrences of two events per entity and compute the duration between them.
analysis.entity_metric_by_arrival Pair two events per entity, as event_durations does, and attach each
analysis.replication_means Reduce a per-entity durations frame to one value per replication.
analysis.mean_confidence_interval Confidence interval for a mean, computed over independent replicate values.
analysis.replication_precision Running confidence-interval precision as replications accumulate.
analysis.queue_size_over_time Compute the size of one or more queues at regular snapshots, across every run.
analysis.resource_use_intervals Pair resource_use/resource_use_end rows into one interval per bout of use.
analysis.resource_utilisation Summarise resource use into busy time, mean-in-use and utilisation, per run.
analysis.resource_occupancy_over_time Compute how many units of each resource step were busy at regular snapshots.
analysis.activity_occupancy_stats Summarise how many entities were present at each step of a process.
analysis.welch_moving_average Smooth an ensemble-averaged series to visually locate a warm-up length.
analysis.compare_replication_values Compare two independent samples of per-replication values.
analysis.flag_outlier_runs Flag replications whose value is a statistical outlier relative to the rest.
analysis.event_occurrence_rate Proportion of replications in which an event occurs at least once.

Analysis Plots

go.Figure-returning charts, each a thin wrapper over the matching function in Analysis Functions above.

plots.plot_queue_size Plot the size of one or more queues over time, across every run.
plots.plot_duration_distribution Plot the distribution of durations between two events.
plots.plot_metric_bar Plot a bar chart of event duration statistics for a list of event pairs.
plots.plot_metric Plot event duration statistics for a list of event pairs, as a bar, box or violin.
plots.plot_resource_utilisation Plot a bar chart of resource utilisation, one bar per group, across runs.
plots.plot_resource_utilisation_over_time Plot how many units of each resource step were in use over time, across runs.
plots.plot_warm_up_diagnostic Plot a Welch (or cumulative-mean) diagnostic for choosing warm_up=.
plots.plot_replication_analysis Plot cumulative-mean precision against replication count.
plots.plot_outlier_runs Horizontal beeswarm of per-replication values, flagging outlier runs.
plots.plot_metric_vs_arrival_time Plot a duration/metric against the arrival time of the entity it belongs to.
plots.plot_scenario_comparison Bar chart comparing a duration statistic between two scenarios.
plots.plot_resource_utilisation_comparison Bar chart comparing a resource utilisation metric between two scenarios.

Event Positioning Utility Functions and Classes

utils.EventPosition Pydantic model for a single event position.
utils.ArrivalPosition EventPosition for the mandatory "arrival" event.
utils.ExitPosition EventPosition for the mandatory "depart" event.
utils.create_event_position_df Creates a DataFrame for event positions from a list of EventPosition objects.

Process Map-Style Outputs

process_mapping.add_sim_timestamp Add a pseudo-timestamp column to a simulation event log.
process_mapping.discover_dfg Discover a Directly-Follows Graph (DFG) from an event log.
process_mapping.dfg_to_graphviz Render a Directly-Follows Graph (DFG) as a Graphviz diagram.
process_mapping.process_nodes_and_edges_for_cytoscape Convert DFG node and edge tables into Cytoscape-compatible elements.
process_mapping.dfg_to_cytoscape Convert DFG node/edge tables to interactive Cytoscape widget.
process_mapping.dfg_to_cytoscape_streamlit Render a Directly-Follows Graph (DFG) interactively in Streamlit using Cytoscape.

Streamlit Utility Functions

utils.streamlit_play_all Programmatically triggers all ‘Play’ buttons in Plotly animations embedded in Streamlit using JavaScript.

ciw Utility Functions

ciw.event_log_from_ciw_recs Build an event log from a ciw.data_record object.
ciw.event_logger_from_ciw_recs Build a vidigi EventLogger from a single ciw.data_record object.
ciw.trial_logger_from_ciw_recs Build a vidigi TrialLogger from several ciw runs’ records.

legacy Functions

resources.VidigiPriorityStoreLegacy A SimPy store that processes requests with priority.
Back to top