diff --git a/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.drawio b/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.drawio
new file mode 100644
index 0000000..f339809
--- /dev/null
+++ b/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.drawio
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.drawio.png b/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.drawio.png
new file mode 100644
index 0000000..aa1b68d
Binary files /dev/null and b/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.drawio.png differ
diff --git a/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.png b/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.png
new file mode 100644
index 0000000..aa1b68d
Binary files /dev/null and b/examples/example_5_simplest_case_wrapped_resources/Simplest Model Background Image - larger treatment area - Horizontal Layout.png differ
diff --git a/examples/example_5_simplest_case_wrapped_resources/__init__.py b/examples/example_5_simplest_case_wrapped_resources/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/examples/example_5_simplest_case_wrapped_resources/ex_5_simplest_case_wrapped_resource.ipynb b/examples/example_5_simplest_case_wrapped_resources/ex_5_simplest_case_wrapped_resource.ipynb
new file mode 100644
index 0000000..6015286
--- /dev/null
+++ b/examples/example_5_simplest_case_wrapped_resources/ex_5_simplest_case_wrapped_resource.ipynb
@@ -0,0 +1,979 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 1: Simplest Case"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from examples.example_1_simplest_case.ex_1_model_classes import Trial, g\n",
+ "from vidigi.animation import animate_activity_log\n",
+ "import pandas as pd\n",
+ "import plotly.io as pio\n",
+ "pio.renderers.default = \"notebook\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "g.n_cubicles = 30\n",
+ "g.trauma_treat_mean = 120\n",
+ "g.trauma_treat_var = 20\n",
+ "g.arrival_rate = 3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "30 nurses\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "my_trial = Trial()\n",
+ "\n",
+ "my_trial.run_trial()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " patient | \n",
+ " pathway | \n",
+ " event_type | \n",
+ " event | \n",
+ " time | \n",
+ " resource_id | \n",
+ " run | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 1 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 0.000000 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 1 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 0.000000 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 1 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 0.000000 | \n",
+ " 1.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 2 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 2.039796 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 2 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 2.039796 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " 2 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 2.039796 | \n",
+ " 2.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 6 | \n",
+ " 3 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 5.098587 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 7 | \n",
+ " 3 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 5.098587 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 8 | \n",
+ " 3 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 5.098587 | \n",
+ " 3.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 9 | \n",
+ " 4 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 5.158007 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 10 | \n",
+ " 4 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 5.158007 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 11 | \n",
+ " 4 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 5.158007 | \n",
+ " 4.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 12 | \n",
+ " 5 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 5.164815 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 13 | \n",
+ " 5 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 5.164815 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 14 | \n",
+ " 5 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 5.164815 | \n",
+ " 5.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 15 | \n",
+ " 6 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 6.815844 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 16 | \n",
+ " 6 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 6.815844 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 17 | \n",
+ " 6 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 6.815844 | \n",
+ " 6.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 18 | \n",
+ " 7 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 11.705665 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 19 | \n",
+ " 7 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 11.705665 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 20 | \n",
+ " 7 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 11.705665 | \n",
+ " 7.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 21 | \n",
+ " 8 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 13.726414 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 22 | \n",
+ " 8 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 13.726414 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 23 | \n",
+ " 8 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 13.726414 | \n",
+ " 8.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 24 | \n",
+ " 9 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 15.992318 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 25 | \n",
+ " 9 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 15.992318 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 26 | \n",
+ " 9 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 15.992318 | \n",
+ " 9.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 27 | \n",
+ " 10 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 24.442676 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 28 | \n",
+ " 10 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 24.442676 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 29 | \n",
+ " 10 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 24.442676 | \n",
+ " 10.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 30 | \n",
+ " 11 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 42.615935 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 31 | \n",
+ " 11 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 42.615935 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 32 | \n",
+ " 11 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 42.615935 | \n",
+ " 11.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 33 | \n",
+ " 12 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 52.475220 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 34 | \n",
+ " 12 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 52.475220 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 35 | \n",
+ " 12 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 52.475220 | \n",
+ " 12.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 36 | \n",
+ " 13 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 52.479083 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 37 | \n",
+ " 13 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 52.479083 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 38 | \n",
+ " 13 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 52.479083 | \n",
+ " 13.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 39 | \n",
+ " 14 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 59.286367 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 40 | \n",
+ " 14 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 59.286367 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 41 | \n",
+ " 14 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 59.286367 | \n",
+ " 14.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 42 | \n",
+ " 15 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 59.503860 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 43 | \n",
+ " 15 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 59.503860 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 44 | \n",
+ " 15 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 59.503860 | \n",
+ " 15.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 45 | \n",
+ " 16 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 62.712061 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 46 | \n",
+ " 16 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 62.712061 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 47 | \n",
+ " 16 | \n",
+ " Simplest | \n",
+ " resource_use | \n",
+ " treatment_begins | \n",
+ " 62.712061 | \n",
+ " 16.0 | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 48 | \n",
+ " 17 | \n",
+ " Simplest | \n",
+ " arrival_departure | \n",
+ " arrival | \n",
+ " 65.258860 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ " 49 | \n",
+ " 17 | \n",
+ " Simplest | \n",
+ " queue | \n",
+ " treatment_wait_begins | \n",
+ " 65.258860 | \n",
+ " NaN | \n",
+ " 0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " patient pathway event_type event time \n",
+ "0 1 Simplest arrival_departure arrival 0.000000 \\\n",
+ "1 1 Simplest queue treatment_wait_begins 0.000000 \n",
+ "2 1 Simplest resource_use treatment_begins 0.000000 \n",
+ "3 2 Simplest arrival_departure arrival 2.039796 \n",
+ "4 2 Simplest queue treatment_wait_begins 2.039796 \n",
+ "5 2 Simplest resource_use treatment_begins 2.039796 \n",
+ "6 3 Simplest arrival_departure arrival 5.098587 \n",
+ "7 3 Simplest queue treatment_wait_begins 5.098587 \n",
+ "8 3 Simplest resource_use treatment_begins 5.098587 \n",
+ "9 4 Simplest arrival_departure arrival 5.158007 \n",
+ "10 4 Simplest queue treatment_wait_begins 5.158007 \n",
+ "11 4 Simplest resource_use treatment_begins 5.158007 \n",
+ "12 5 Simplest arrival_departure arrival 5.164815 \n",
+ "13 5 Simplest queue treatment_wait_begins 5.164815 \n",
+ "14 5 Simplest resource_use treatment_begins 5.164815 \n",
+ "15 6 Simplest arrival_departure arrival 6.815844 \n",
+ "16 6 Simplest queue treatment_wait_begins 6.815844 \n",
+ "17 6 Simplest resource_use treatment_begins 6.815844 \n",
+ "18 7 Simplest arrival_departure arrival 11.705665 \n",
+ "19 7 Simplest queue treatment_wait_begins 11.705665 \n",
+ "20 7 Simplest resource_use treatment_begins 11.705665 \n",
+ "21 8 Simplest arrival_departure arrival 13.726414 \n",
+ "22 8 Simplest queue treatment_wait_begins 13.726414 \n",
+ "23 8 Simplest resource_use treatment_begins 13.726414 \n",
+ "24 9 Simplest arrival_departure arrival 15.992318 \n",
+ "25 9 Simplest queue treatment_wait_begins 15.992318 \n",
+ "26 9 Simplest resource_use treatment_begins 15.992318 \n",
+ "27 10 Simplest arrival_departure arrival 24.442676 \n",
+ "28 10 Simplest queue treatment_wait_begins 24.442676 \n",
+ "29 10 Simplest resource_use treatment_begins 24.442676 \n",
+ "30 11 Simplest arrival_departure arrival 42.615935 \n",
+ "31 11 Simplest queue treatment_wait_begins 42.615935 \n",
+ "32 11 Simplest resource_use treatment_begins 42.615935 \n",
+ "33 12 Simplest arrival_departure arrival 52.475220 \n",
+ "34 12 Simplest queue treatment_wait_begins 52.475220 \n",
+ "35 12 Simplest resource_use treatment_begins 52.475220 \n",
+ "36 13 Simplest arrival_departure arrival 52.479083 \n",
+ "37 13 Simplest queue treatment_wait_begins 52.479083 \n",
+ "38 13 Simplest resource_use treatment_begins 52.479083 \n",
+ "39 14 Simplest arrival_departure arrival 59.286367 \n",
+ "40 14 Simplest queue treatment_wait_begins 59.286367 \n",
+ "41 14 Simplest resource_use treatment_begins 59.286367 \n",
+ "42 15 Simplest arrival_departure arrival 59.503860 \n",
+ "43 15 Simplest queue treatment_wait_begins 59.503860 \n",
+ "44 15 Simplest resource_use treatment_begins 59.503860 \n",
+ "45 16 Simplest arrival_departure arrival 62.712061 \n",
+ "46 16 Simplest queue treatment_wait_begins 62.712061 \n",
+ "47 16 Simplest resource_use treatment_begins 62.712061 \n",
+ "48 17 Simplest arrival_departure arrival 65.258860 \n",
+ "49 17 Simplest queue treatment_wait_begins 65.258860 \n",
+ "\n",
+ " resource_id run \n",
+ "0 NaN 0 \n",
+ "1 NaN 0 \n",
+ "2 1.0 0 \n",
+ "3 NaN 0 \n",
+ "4 NaN 0 \n",
+ "5 2.0 0 \n",
+ "6 NaN 0 \n",
+ "7 NaN 0 \n",
+ "8 3.0 0 \n",
+ "9 NaN 0 \n",
+ "10 NaN 0 \n",
+ "11 4.0 0 \n",
+ "12 NaN 0 \n",
+ "13 NaN 0 \n",
+ "14 5.0 0 \n",
+ "15 NaN 0 \n",
+ "16 NaN 0 \n",
+ "17 6.0 0 \n",
+ "18 NaN 0 \n",
+ "19 NaN 0 \n",
+ "20 7.0 0 \n",
+ "21 NaN 0 \n",
+ "22 NaN 0 \n",
+ "23 8.0 0 \n",
+ "24 NaN 0 \n",
+ "25 NaN 0 \n",
+ "26 9.0 0 \n",
+ "27 NaN 0 \n",
+ "28 NaN 0 \n",
+ "29 10.0 0 \n",
+ "30 NaN 0 \n",
+ "31 NaN 0 \n",
+ "32 11.0 0 \n",
+ "33 NaN 0 \n",
+ "34 NaN 0 \n",
+ "35 12.0 0 \n",
+ "36 NaN 0 \n",
+ "37 NaN 0 \n",
+ "38 13.0 0 \n",
+ "39 NaN 0 \n",
+ "40 NaN 0 \n",
+ "41 14.0 0 \n",
+ "42 NaN 0 \n",
+ "43 NaN 0 \n",
+ "44 15.0 0 \n",
+ "45 NaN 0 \n",
+ "46 NaN 0 \n",
+ "47 16.0 0 \n",
+ "48 NaN 0 \n",
+ "49 NaN 0 "
+ ]
+ },
+ "execution_count": 28,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "my_trial.all_event_logs.head(50)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "event_position_df = pd.DataFrame([\n",
+ " {'event': 'arrival',\n",
+ " 'x': 50, 'y': 300,\n",
+ " 'label': \"Arrival\" },\n",
+ "\n",
+ " # Triage - minor and trauma\n",
+ " {'event': 'treatment_wait_begins',\n",
+ " 'x': 205, 'y': 275,\n",
+ " 'label': \"Waiting for Treatment\"},\n",
+ "\n",
+ " {'event': 'treatment_begins',\n",
+ " 'x': 205, 'y': 175,\n",
+ " 'resource':'n_cubicles',\n",
+ " 'label': \"Being Treated\"},\n",
+ "\n",
+ " {'event': 'exit',\n",
+ " 'x': 270, 'y': 70,\n",
+ " 'label': \"Exit\"}\n",
+ "\n",
+ " ])\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Animation function called at 13:43:14\n",
+ "Iteration through minute-by-minute logs complete 13:43:16\n",
+ "Snapshot df concatenation complete at 13:43:16\n",
+ "Reshaped animation dataframe finished construction at 13:43:17\n",
+ "Placement dataframe finished construction at 13:43:17\n",
+ "Output animation generation complete at 13:43:19\n",
+ "Total Time Elapsed: 4.54 seconds\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ " \n",
+ " "
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "animate_activity_log(\n",
+ " event_log=my_trial.all_event_logs[my_trial.all_event_logs['run']==1],\n",
+ " event_position_df= event_position_df,\n",
+ " scenario=g(),\n",
+ " debug_mode=True,\n",
+ " setup_mode=False,\n",
+ " every_x_time_units=1,\n",
+ " include_play_button=True,\n",
+ " icon_and_text_size=20,\n",
+ " gap_between_entities=6,\n",
+ " gap_between_rows=25,\n",
+ " plotly_height=700,\n",
+ " frame_duration=200,\n",
+ " plotly_width=1200,\n",
+ " override_x_max=300,\n",
+ " override_y_max=500,\n",
+ " limit_duration=g.sim_duration,\n",
+ " wrap_queues_at=25,\n",
+ " wrap_resources_at=None,\n",
+ " step_snapshot_max=125,\n",
+ " time_display_units=\"dhm\",\n",
+ " display_stage_labels=False,\n",
+ " add_background_image=\"https://raw.githubusercontent.com/Bergam0t/vidigi/refs/heads/main/examples/example_1_simplest_case/Simplest%20Model%20Background%20Image%20-%20Horizontal%20Layout.drawio.png\",\n",
+ " )"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "event_position_df = pd.DataFrame([\n",
+ " {'event': 'arrival',\n",
+ " 'x': 50, 'y': 300,\n",
+ " 'label': \"Arrival\" },\n",
+ "\n",
+ " # Triage - minor and trauma\n",
+ " {'event': 'treatment_wait_begins',\n",
+ " 'x': 225, 'y': 280,\n",
+ " 'label': \"Waiting for Treatment\"},\n",
+ "\n",
+ " {'event': 'treatment_begins',\n",
+ " 'x': 225, 'y': 120,\n",
+ " 'resource':'n_cubicles',\n",
+ " 'label': \"Being Treated\"},\n",
+ "\n",
+ " {'event': 'exit',\n",
+ " 'x': 270, 'y': 70,\n",
+ " 'label': \"Exit\"}\n",
+ "\n",
+ " ])\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Animation function called at 13:43:19\n",
+ "Iteration through minute-by-minute logs complete 13:43:22\n",
+ "Snapshot df concatenation complete at 13:43:22\n",
+ "Reshaped animation dataframe finished construction at 13:43:22\n",
+ "Placement dataframe finished construction at 13:43:22\n",
+ "Output animation generation complete at 13:43:24\n",
+ "Total Time Elapsed: 4.70 seconds\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "animate_activity_log(\n",
+ " event_log=my_trial.all_event_logs[my_trial.all_event_logs['run']==1],\n",
+ " event_position_df= event_position_df,\n",
+ " scenario=g(),\n",
+ " debug_mode=True,\n",
+ " setup_mode=True,\n",
+ " every_x_time_units=1,\n",
+ " include_play_button=True,\n",
+ " icon_and_text_size=20,\n",
+ " gap_between_entities=6,\n",
+ " gap_between_rows=25,\n",
+ " plotly_height=700,\n",
+ " frame_duration=200,\n",
+ " plotly_width=1200,\n",
+ " override_x_max=300,\n",
+ " override_y_max=500,\n",
+ " limit_duration=g.sim_duration,\n",
+ " wrap_queues_at=25,\n",
+ " wrap_resources_at=15,\n",
+ " step_snapshot_max=125,\n",
+ " time_display_units=\"dhm\",\n",
+ " display_stage_labels=False,\n",
+ " add_background_image=\"Simplest Model Background Image - larger treatment area - Horizontal Layout.png\",\n",
+ " )"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "vidigi_package_dev",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}