From ec7b54a5ae0ef26a7d6f48dd12245e12e716c16b Mon Sep 17 00:00:00 2001 From: stijnlamers <92167307+stijnlamers@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:13:48 +0100 Subject: [PATCH] Add files via upload --- ...ngleRun_with_HasEnergyPluginSALamers.ipynb | 3470 +++++++++++++++++ 1 file changed, 3470 insertions(+) create mode 100644 notebooks/18_SingleRun_with_HasEnergyPluginSALamers.ipynb diff --git a/notebooks/18_SingleRun_with_HasEnergyPluginSALamers.ipynb b/notebooks/18_SingleRun_with_HasEnergyPluginSALamers.ipynb new file mode 100644 index 00000000..8d2a9393 --- /dev/null +++ b/notebooks/18_SingleRun_with_HasEnergyPluginSALamers.ipynb @@ -0,0 +1,3470 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Demo: SingleRun with HasDelayPlugin\n", + "The basic steps to set up an OpenCLSim simulation are:\n", + "* Import libraries\n", + "* Initialise simpy environment\n", + "* Define object classes\n", + "* Create objects\n", + " * Create sites\n", + " * Create vessels\n", + " * Create activities\n", + "* Register processes and run simpy\n", + "\n", + "----\n", + "\n", + "This example notebook shows how you can integrate percentual delays in your simulation. We demonstrate how you can use the HasDelayPlugin, and how you can give it a certain delay percentage." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 0. Import libraries" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import datetime, time\n", + "import simpy\n", + "\n", + "import shapely.geometry\n", + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "import openclsim.core as core\n", + "import openclsim.model as model\n", + "import openclsim.plot as plot\n", + "import openclsim.plugins as plugins\n", + "import opentnsim.core\n", + "\n", + "# TO DO\n", + "# See chat for power to velocity\n", + "# insert acceleration with power2v function. Better implementation for calculate power\n", + "# One notebook for calculating velocity depending on a set power. From 0 to end. Need to know resistance over time for increasing velocity.\n", + "# Add resistance for seagoing\n", + "# Depth integration. Varying depth over the graph -> see M v koningsveld. Might connect with opentnsim. move function -> velocity will be connected together." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def calculate_power(V_0=10, h=100):\n", + " \n", + " \n", + " # Define all parameters (HAM318):\n", + " L=225\n", + " B=20\n", + " T=19\n", + " nu=0.000001\n", + " C_b=0.85\n", + " rho=1025\n", + " c_stern = 1\n", + " one_k2=2.5\n", + " g=9.81\n", + "\n", + "\n", + " ###########################################################################################################################\n", + "\n", + " \"\"\"1) Frictional resistance\n", + " - 1st resistance component defined by Holtrop and Mennen (1982)\n", + " - A modification to the original friction line is applied, based on literature of Zeng (2018), to account for shallow water effects \"\"\"\n", + "\n", + " C_M = 1.006 - 0.0056 * C_b ** (-3.56) # Midship section coefficient\n", + " C_wp = (1 + 2 * C_b) / 3 # Waterplane coefficient\n", + " C_p = C_b / C_M # Prismatic coefficient\n", + "\n", + " delta = C_b * L * B * T # Water displacement\n", + "\n", + " lcb = -13.5 + 19.4 * C_p # longitudinal center of buoyancy\n", + " L_R = L * (1 - C_p + (0.06 * C_p * lcb) / (\n", + " 4 * C_p - 1)) # parameter reflecting the length of the run\n", + "\n", + " A_T = 0.2 * B * T # transverse area of the transom\n", + "\n", + " # Total wet area\n", + " S_T = L * (2 * T + B) * np.sqrt(C_M) * (\n", + " 0.453 + 0.4425 * C_b - 0.2862 * C_M - 0.003467 * (\n", + " B / T) + 0.3696 * C_wp) # + 2.38 * (A_BT / C_b)\n", + "\n", + " S_APP = 0.05 * S_T # Wet area of appendages\n", + " S_B = L * B # Area of flat bottom\n", + "\n", + " D_s = 0.7 * T # Diameter of the screw\n", + "\n", + "\n", + " R_e = V_0 * L / nu # Reynolds number\n", + " D = h - T # distance from bottom ship to the bottom of the fairway\n", + "\n", + " # Friction coefficient in deep water\n", + " Cf_0 = 0.075 / ((np.log10(R_e) - 2) ** 2)\n", + "\n", + " # Friction coefficient proposed, taking into account shallow water effects\n", + " Cf_proposed = (0.08169 / ((np.log10(R_e) - 1.717) ** 2)) * (\n", + " 1 + (0.003998 / (np.log10(R_e) - 4.393)) * (D / L) ** (-1.083))\n", + "\n", + " # 'a' is the coefficient needed to calculate the Katsui friction coefficient\n", + " a = 0.042612 * np.log10(R_e) + 0.56725\n", + " Cf_katsui = 0.0066577 / ((np.log10(R_e) - 4.3762) ** a)\n", + "\n", + " # The average velocity underneath the ship, taking into account the shallow water effect\n", + "\n", + " if h / T <= 4:\n", + " V_B = 0.4277 * V_0 * np.exp((h / T) ** (-0.07625))\n", + " else:\n", + " V_B = V_0\n", + "\n", + " # cf_proposed cannot be applied directly, since a vessel also has non-horizontal wet surfaces that have to be taken\n", + " # into account. Therefore, the following formula for the final friction coefficient 'C_f' is defined:\n", + " C_f = Cf_0 + (Cf_proposed - Cf_katsui) * (S_B / S_T) * (V_B / V_0) ** 2\n", + "\n", + " # The total frictional resistance R_f [kN]:\n", + " R_f = (C_f * 0.5 * rho * (V_0 ** 2) * S_T) / 1000\n", + "\n", + " ########################################################################################################################\n", + "\n", + " \"\"\"2) Viscous resistance\n", + " - 2nd resistance component defined by Holtrop and Mennen (1982)\n", + " - Form factor (1 + k1) has to be multiplied by the frictional resistance R_f, to account for the effect of viscosity\"\"\"\n", + "\n", + " # c_14 accounts for the specific shape of the afterbody\n", + " c_14 = 1 + 0.0011 * c_stern\n", + "\n", + " # the form factor (1+k1) describes the viscous resistance\n", + " one_k1 = 0.93 + 0.487 * c_14 * ((B / L) ** 1.068) * ((T / L) ** 0.461) * (\n", + " (L / L_R) ** 0.122) * (((L ** 3) / delta) ** 0.365) * (\n", + " (1 - C_p) ** (-0.604))\n", + "\n", + " ########################################################################################################################\n", + "\n", + "\n", + " \"\"\"3) Appendage resistance\n", + " - 3rd resistance component defined by Holtrop and Mennen (1982)\n", + " - Appendages (like a rudder, shafts, skeg) result in additional frictional resistance\"\"\"\n", + "\n", + " # Frictional resistance resulting from wetted area of appendages: R_APP [kN]\n", + " R_APP = (0.5 * rho * (V_0 ** 2) * S_APP * one_k2 * C_f) / 1000\n", + "\n", + " #################################################################################################################\n", + "\n", + "\n", + " \"\"\"Intermediate calculation: Karpov\n", + " - The Karpov method computes a velocity correction that accounts for limited water depth (corrected velocity V2)\n", + " - V2 has to be implemented in the wave resistance and the residual resistance terms\"\"\"\n", + "\n", + " # The Froude number used in the Karpov method is the depth related froude number F_nh\n", + "\n", + " # The different alpha** curves are determined with a sixth power polynomial approximation in Excel\n", + " # A distinction is made between different ranges of Froude numbers, because this resulted in a better approximation of the curve\n", + " F_nh = V_0 / np.sqrt(g * h)\n", + "\n", + " if F_nh <= 0.4:\n", + "\n", + " if 0 <= h / T < 1.75:\n", + " alpha_xx = (-4 * 10 ** (\n", + " -12)) * F_nh ** 3 - 0.2143 * F_nh ** 2 - 0.0643 * F_nh + 0.9997\n", + " if 1.75 <= h / T < 2.25:\n", + " alpha_xx = -0.8333 * F_nh ** 3 + 0.25 * F_nh ** 2 - 0.0167 * F_nh + 1\n", + " if 2.25 <= h / T < 2.75:\n", + " alpha_xx = -1.25 * F_nh ** 4 + 0.5833 * F_nh ** 3 - 0.0375 * F_nh ** 2 - 0.0108 * F_nh + 1\n", + " if h / T >= 2.75:\n", + " alpha_xx = 1\n", + "\n", + " if F_nh > 0.4:\n", + " if 0 <= h / T < 1.75:\n", + " alpha_xx = -0.9274 * F_nh ** 6 + 9.5953 * F_nh ** 5 - 37.197 * F_nh ** 4 + 69.666 * F_nh ** 3 - 65.391 * F_nh ** 2 + 28.025 * F_nh - 3.4143\n", + " if 1.75 <= h / T < 2.25:\n", + " alpha_xx = 2.2152 * F_nh ** 6 - 11.852 * F_nh ** 5 + 21.499 * F_nh ** 4 - 12.174 * F_nh ** 3 - 4.7873 * F_nh ** 2 + 5.8662 * F_nh - 0.2652\n", + " if 2.25 <= h / T < 2.75:\n", + " alpha_xx = 1.2205 * F_nh ** 6 - 5.4999 * F_nh ** 5 + 5.7966 * F_nh ** 4 + 6.6491 * F_nh ** 3 - 16.123 * F_nh ** 2 + 9.2016 * F_nh - 0.6342\n", + " if 2.75 <= h / T < 3.25:\n", + " alpha_xx = -0.4085 * F_nh ** 6 + 4.534 * F_nh ** 5 - 18.443 * F_nh ** 4 + 35.744 * F_nh ** 3 - 34.381 * F_nh ** 2 + 15.042 * F_nh - 1.3807\n", + " if 3.25 <= h / T < 3.75:\n", + " alpha_xx = 0.4078 * F_nh ** 6 - 0.919 * F_nh ** 5 - 3.8292 * F_nh ** 4 + 15.738 * F_nh ** 3 - 19.766 * F_nh ** 2 + 9.7466 * F_nh - 0.6409\n", + " if 3.75 <= h / T < 4.5:\n", + " alpha_xx = 0.3067 * F_nh ** 6 - 0.3404 * F_nh ** 5 - 5.0511 * F_nh ** 4 + 16.892 * F_nh ** 3 - 20.265 * F_nh ** 2 + 9.9002 * F_nh - 0.6712\n", + " if 4.5 <= h / T < 5.5:\n", + " alpha_xx = 0.3212 * F_nh ** 6 - 0.3559 * F_nh ** 5 - 5.1056 * F_nh ** 4 + 16.926 * F_nh ** 3 - 20.253 * F_nh ** 2 + 10.013 * F_nh - 0.7196\n", + " if 5.5 <= h / T < 6.5:\n", + " alpha_xx = 0.9252 * F_nh ** 6 - 4.2574 * F_nh ** 5 + 5.0363 * F_nh ** 4 + 3.3282 * F_nh ** 3 - 10.367 * F_nh ** 2 + 6.3993 * F_nh - 0.2074\n", + " if 6.5 <= h / T < 7.5:\n", + " alpha_xx = 0.8442 * F_nh ** 6 - 4.0261 * F_nh ** 5 + 5.313 * F_nh ** 4 + 1.6442 * F_nh ** 3 - 8.1848 * F_nh ** 2 + 5.3209 * F_nh - 0.0267\n", + " if 7.5 <= h / T < 8.5:\n", + " alpha_xx = 0.1211 * F_nh ** 6 + 0.628 * F_nh ** 5 - 6.5106 * F_nh ** 4 + 16.7 * F_nh ** 3 - 18.267 * F_nh ** 2 + 8.7077 * F_nh - 0.4745\n", + "\n", + " if 8.5 <= h / T < 9.5:\n", + " if F_nh < 0.6:\n", + " alpha_xx = 1\n", + " if F_nh >= 0.6:\n", + " alpha_xx = -6.4069 * F_nh ** 6 + 47.308 * F_nh ** 5 - 141.93 * F_nh ** 4 + 220.23 * F_nh ** 3 - 185.05 * F_nh ** 2 + 79.25 * F_nh - 12.484\n", + " if h / T >= 9.5:\n", + " if F_nh < 0.6:\n", + " alpha_xx = 1\n", + " if F_nh >= 0.6:\n", + " alpha_xx = -6.0727 * F_nh ** 6 + 44.97 * F_nh ** 5 - 135.21 * F_nh ** 4 + 210.13 * F_nh ** 3 - 176.72 * F_nh ** 2 + 75.728 * F_nh - 11.893\n", + "\n", + " V_2 = V_0 / alpha_xx\n", + "\n", + " #################################################################################################################\n", + "\n", + "\n", + " \"\"\"4) Wave resistance\n", + " - 4th resistance component defined by Holtrop and Mennen (1982)\n", + " - When the speed or the vessel size increases, the wave making resistance increases\n", + " - In shallow water, the wave resistance shows an asymptotical behaviour by reaching the critical speed\"\"\"\n", + "\n", + "\n", + " F_n = V_2 / np.sqrt(g * L) # Froude number\n", + "\n", + " # parameter c_7 is determined by the B/L ratio\n", + " if B / L < 0.11:\n", + " c_7 = 0.229577 * (B / L) ** 0.33333\n", + " if B / L > 0.25:\n", + " c_7 = 0.5 - 0.0625 * (L / B)\n", + " else:\n", + " c_7 = B / L\n", + "\n", + " # half angle of entrance in degrees\n", + " i_E = 1 + 89 * np.exp(-((L / B) ** 0.80856) * ((1 - C_wp) ** 0.30484) * (\n", + " (1 - C_p - 0.0225 * lcb) ** 0.6367) * ((L_R / B) ** 0.34574) * (\n", + " (100 * delta / (L ** 3)) ** 0.16302))\n", + "\n", + " c_1 = 2223105 * (c_7 ** 3.78613) * ((T / B) ** 1.07961) * (90 - i_E) ** (-1.37165)\n", + " c_2 = 1 # accounts for the effect of the bulbous bow, which is not present at inland ships\n", + " c_5 = 1 - (0.8 * A_T) / (\n", + " B * T * C_M) # influence of the transom stern on the wave resistance\n", + "\n", + " # parameter c_15 depoends on the ratio L^3 / delta\n", + " if (L ** 3) / delta < 512:\n", + " c_15 = -1.69385\n", + " if (L ** 3) / delta > 1727:\n", + " c_15 = 0\n", + " else:\n", + " c_15 = -1.69385 + (L / (delta ** (1 / 3)) - 8) / 2.36\n", + "\n", + " # parameter c_16 depends on C_p\n", + " if C_p < 0.8:\n", + " c_16 = 8.07981 * C_p - 13.8673 * (C_p ** 2) + 6.984388 * (C_p ** 3)\n", + " else:\n", + " c_16 = 1.73014 - 0.7067\n", + "\n", + " m_1 = 0.0140407 * (L / T) - 1.75254 * ((delta) ** (1 / 3) / L) - 4.79323 * (\n", + " B / L) - c_16\n", + "\n", + " m_4 = 0.4 * c_15 * np.exp(-0.034 * (F_n ** (-3.29)))\n", + "\n", + " if L / B < 12:\n", + " lmbda = 1.446 * C_p - 0.03 * (L / B)\n", + " else:\n", + " lmbda = 1.446 * C_p - 0.036\n", + "\n", + " # parameters needed for RW_2\n", + " c_17 = 6919.3 * (C_M ** (-1.3346)) * ((delta / (L ** 3)) ** 2.00977) * (\n", + " (L / B - 2) ** 1.40692)\n", + " m_3 = -7.2035 * ((B / L) ** 0.326869) * ((T / B) ** 0.605375)\n", + "\n", + " ######### When Fn < 0.4\n", + " RW_1 = c_1 * c_2 * c_5 * delta * rho * g * np.exp(\n", + " m_1 * (F_n ** (-0.9)) + m_4 * np.cos(lmbda * (F_n ** (-2))))\n", + "\n", + " ######## When Fn > 0.5\n", + " RW_2 = c_17 * c_2 * c_5 * delta * rho * g * np.exp(\n", + " m_3 * (F_n ** (-0.9)) + m_4 * np.cos(lmbda * (F_n ** (-2))))\n", + "\n", + " if F_n < 0.4:\n", + " R_W = RW_1 / 1000 # kN\n", + " if F_n > 0.55:\n", + " R_W = RW_2 / 1000 # kN\n", + " else:\n", + " R_W = (RW_1 + ((10 * F_n - 4) * (RW_2 - RW_1)) / 1.5) / 1000 # kN\n", + "\n", + " #################################################################################################################\n", + "\n", + "\n", + " \"\"\"5) Residual resistance terms\n", + " - Holtrop and Mennen (1982) defined three residual resistance terms:\n", + " - 1) Resistance due to the bulbous bow (not incorporated since inland ships in general don't have a bulb)\n", + " - 2) Resistance due to immersed transom\n", + " - 3) Resistance due to model-ship correlation \"\"\"\n", + "\n", + " # Resistance due to immersed transom: R_TR [kN]\n", + " F_nt = V_2 / np.sqrt(\n", + " 2 * g * A_T / (B + B * C_wp)) # Froude number based on transom immersion\n", + " c_6 = 0.2 * (1 - 0.2 * F_nt) # Assuming F_nt < 5, this is the expression for coefficient c_6\n", + "\n", + " R_TR = (0.5 * rho * (V_2 ** 2) * A_T * c_6) / 1000\n", + "\n", + " # Model-ship correlation resistance: R_A [kN]\n", + "\n", + " if T / L < 0.04:\n", + " c_4 = T / L\n", + " else:\n", + " c_4 = 0.04\n", + " c_2 = 1\n", + "\n", + " C_A = 0.006 * (L + 100) ** (-0.16) - 0.00205 + 0.003 * np.sqrt(L / 7.5) * (\n", + " C_b ** 4) * c_2 * (0.04 - c_4)\n", + "\n", + " ####### Holtrop and Mennen in the document of Sarris, 2003 #######\n", + " R_A = (0.5 * rho * (V_2 ** 2) * S_T * C_A) / 1000 # kW\n", + "\n", + " #################################################################################################################\n", + "\n", + " R_tot = R_f*one_k1 + R_APP + R_W + R_TR + R_A\n", + " print('total resistance =',R_tot)\n", + " P_empty=R_tot * V_0\n", + " P_full = R_tot * 1.2 * V_0\n", + " return P_empty" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "class HasEnergyPlugin:\n", + " \"\"\"Mixin for Activity to initialize WeatherPluginActivity.\"\"\"\n", + " \n", + " def __init__(self, *args, **kwargs):\n", + " super().__init__(*args, **kwargs)\n", + "\n", + " energy_plugin = EnergyPlugin()\n", + " self.register_plugin(plugin=energy_plugin, priority=3)\n", + "\n", + "\n", + "class EnergyPlugin(model.AbstractPluginClass):\n", + " \"\"\"Mixin for all activities to add delay and downtime.\"\"\"\n", + "\n", + " def __init__(self, *args, **kwargs):\n", + " super().__init__(*args, **kwargs)\n", + " \n", + " \n", + " def post_process(\n", + " self, env, activity_log, activity, start_activity, *args, **kwargs\n", + " ):\n", + " print('post_process',activity.mover,activity)\n", + " V_0=activity.mover.compute_v(None)\n", + " self.power = calculate_power(V_0=V_0)\n", + "\n", + " activity_duration = env.now - start_activity\n", + " activity.log_entry(\n", + " t=env.now,\n", + " activity_id=activity.id,\n", + " activity_state=core.LogState.UNKNOWN,\n", + " additional_state={\n", + " \"power\":self.power,\n", + " \"activity_duration\":activity_duration,\n", + " \"energy_used\":self.power*activity_duration,\n", + " }\n", + " )\n", + " return {}\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 1. Initialise simpy environment" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# setup environment (simulation time needs to match the available weather data)\n", + "simulation_start = 0\n", + "my_env = simpy.Environment(initial_time=simulation_start)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 2. Define object classes" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# create a Site object based on desired mixin classes\n", + "Site = type(\n", + " \"Site\",\n", + " (\n", + " core.Identifiable,\n", + " core.Log,\n", + " core.Locatable,\n", + " core.HasContainer,\n", + " core.HasResource,\n", + " ),\n", + " {},\n", + ")\n", + "\n", + "# create a TransportProcessingResource object based on desired mixin classes\n", + "TransportProcessingResource = type(\n", + " \"TransportProcessingResource\",\n", + " (\n", + " core.Identifiable,\n", + " core.Log,\n", + " core.ContainerDependentMovable,\n", + " core.Processor,\n", + " core.HasResource,\n", + " core.LoadingFunction,\n", + " core.UnloadingFunction\n", + " ),\n", + " {},\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 3. Create objects\n", + "##### 3.1. Create site object(s)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# prepare input data for from_site\n", + "location_from_site = shapely.geometry.Point(4.0, 52.11428333)\n", + "data_from_site = {\"env\": my_env,\n", + " \"name\": \"from_site\",\n", + " \"geometry\": location_from_site,\n", + " \"capacity\": 12,\n", + " \"level\": 12\n", + " }\n", + "# instantiate from_site \n", + "from_site = Site(**data_from_site)\n", + "\n", + "# prepare input data for to_site\n", + "location_to_site = shapely.geometry.Point(4.1, 52.11428333)\n", + "data_to_site = {\"env\": my_env,\n", + " \"name\": \"to_site\",\n", + " \"geometry\": location_to_site,\n", + " \"capacity\": 12,\n", + " \"level\": 0\n", + " }\n", + "# instantiate to_site \n", + "to_site = Site(**data_to_site)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### 3.2. Create vessel object(s)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# prepare input data for vessel_01\n", + "data_vessel01 = {\"env\": my_env,\n", + " \"name\": \"vessel01\",\n", + " \"geometry\": location_from_site, \n", + " \"loading_rate\": 1,\n", + " \"unloading_rate\": 1,\n", + " \"capacity\": 4,\n", + " \"compute_v\": lambda x: 5\n", + " }\n", + "# instantiate vessel_01 \n", + "vessel01 = TransportProcessingResource(**data_vessel01)\n", + "# Monkeypatch with L: Data from EIS HAM318\n", + "# vessel01.L = 225.71\n", + "# vessel01.B = 32.046\n", + "# vessel01.T = 13.55" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### 3.3 Create activity/activities" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# initialise registry\n", + "registry = {}\n", + "keep_resources = {}" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# create delay sequence activities\n", + "DelaySequenceActivity = type(\n", + " \"TestShiftActivity\",\n", + " (\n", + " model.SequentialActivity, # the order is critical!\n", + " ),\n", + " {},\n", + ")\n", + "\n", + "DelayWhileActivity = type(\n", + " \"TestShiftActivity\",\n", + " (\n", + " model.WhileActivity, # the order is critical!\n", + " ),\n", + " {},\n", + ")\n", + "\n", + "DelayMoveActivity = type(\n", + " \"TestMoveActivity\",\n", + " (\n", + " HasEnergyPlugin,\n", + " model.MoveActivity, # the order is critical!\n", + " ),\n", + " {},\n", + ")\n", + "\n", + "DelayShiftActivity = type(\n", + " \"TestShiftActivity\",\n", + " (\n", + " model.ShiftAmountActivity, # the order is critical!\n", + " ),\n", + " {},\n", + ")\n", + "\n", + "EnergyBasicActivity = type(\n", + " \"TestShiftActivity\",\n", + " (\n", + " model.BasicActivity, # the order is critical!\n", + " ),\n", + " {},\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "# create a list of the sub processes\n", + "sub_processes = [\n", + " DelayMoveActivity(\n", + " env=my_env,\n", + " name=\"sailing empty\",\n", + " registry=registry,\n", + " mover=vessel01,\n", + " destination=from_site,\n", + " ),\n", + " DelayShiftActivity(\n", + " env=my_env,\n", + " name=\"load cargo\",\n", + " registry=registry,\n", + " processor=vessel01,\n", + " origin=from_site,\n", + " destination=vessel01,\n", + " amount=4,\n", + " duration=0,\n", + " ),\n", + " DelayMoveActivity(\n", + " env=my_env,\n", + " name=\"sailing full\",\n", + " registry=registry,\n", + " mover=vessel01,\n", + " destination=to_site,\n", + " ),\n", + " DelayShiftActivity(\n", + " env=my_env,\n", + " name=\"unload cargo\",\n", + " registry=registry,\n", + " processor=vessel01,\n", + " origin=vessel01,\n", + " destination=to_site,\n", + " amount=4,\n", + " duration=0,\n", + " ),\n", + " EnergyBasicActivity(\n", + " env=my_env,\n", + " name=\"Basic activity\",\n", + " registry=registry,\n", + " duration=0,\n", + " additional_logs=[vessel01],\n", + " ),\n", + "]\n", + "\n", + "# create a 'sequential activity' that is made up of the 'sub_processes'\n", + "sequential_activity = DelaySequenceActivity(\n", + " env=my_env,\n", + " name=\"Single run process\",\n", + " registry=registry,\n", + " sub_processes=sub_processes,\n", + ")\n", + "\n", + "# create a while activity that executes the 'sequential activity' while a stop condition is not met \n", + "while_activity = DelayWhileActivity(\n", + " env=my_env,\n", + " name=\"While activity\",\n", + " registry=registry,\n", + " sub_processes=[sequential_activity],\n", + " condition_event=[{\"type\": \"container\", \"concept\": to_site, \"state\": \"full\"}],\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 4. Register processes and run simpy" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "post_process <__main__.TransportProcessingResource object at 0x000001B0BA01EE60> <__main__.TestMoveActivity object at 0x000001B0CD02F460>\n", + "total resistance = 515.8799993865017\n", + "post_process <__main__.TransportProcessingResource object at 0x000001B0BA01EE60> <__main__.TestMoveActivity object at 0x000001B0CD02FEE0>\n", + "total resistance = 515.8799993865017\n", + "post_process <__main__.TransportProcessingResource object at 0x000001B0BA01EE60> <__main__.TestMoveActivity object at 0x000001B0CD02F460>\n", + "total resistance = 515.8799993865017\n", + "post_process <__main__.TransportProcessingResource object at 0x000001B0BA01EE60> <__main__.TestMoveActivity object at 0x000001B0CD02FEE0>\n", + "total resistance = 515.8799993865017\n", + "post_process <__main__.TransportProcessingResource object at 0x000001B0BA01EE60> <__main__.TestMoveActivity object at 0x000001B0CD02F460>\n", + "total resistance = 515.8799993865017\n", + "post_process <__main__.TransportProcessingResource object at 0x000001B0BA01EE60> <__main__.TestMoveActivity object at 0x000001B0CD02FEE0>\n", + "total resistance = 515.8799993865017\n" + ] + } + ], + "source": [ + "model.register_processes([while_activity])\n", + "my_env.run()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### 5. Inspect results\n", + "##### 5.1 Inspect logs" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ActivityTimestampActivityStatepoweractivity_durationenergy_used
0sailing empty1970-01-01 00:00:00.000000STARTNaNNaNNaN
1sailing empty1970-01-01 00:00:00.000000STOPNaNNaNNaN
2sailing empty1970-01-01 00:00:00.000000UNKNOWN2579.3999970.0000000.000000e+00
0sailing full1970-01-01 00:00:00.000000STARTNaNNaNNaN
0load cargo1970-01-01 00:00:00.000000STARTNaNNaNNaN
1load cargo1970-01-01 00:00:00.000000STOPNaNNaNNaN
1Basic activity1970-01-01 00:22:50.059695STOPNaNNaNNaN
0Basic activity1970-01-01 00:22:50.059695STARTNaNNaNNaN
1unload cargo1970-01-01 00:22:50.059695STOPNaNNaNNaN
0unload cargo1970-01-01 00:22:50.059695STARTNaNNaNNaN
1sailing full1970-01-01 00:22:50.059695STOPNaNNaNNaN
2sailing full1970-01-01 00:22:50.059695UNKNOWN2579.3999971370.0596953.533932e+06
3sailing empty1970-01-01 00:22:50.059695STARTNaNNaNNaN
3load cargo1970-01-01 00:45:40.119390STOPNaNNaNNaN
5sailing empty1970-01-01 00:45:40.119390UNKNOWN2579.3999971370.0596953.533932e+06
2load cargo1970-01-01 00:45:40.119390STARTNaNNaNNaN
3sailing full1970-01-01 00:45:40.119390STARTNaNNaNNaN
4sailing empty1970-01-01 00:45:40.119390STOPNaNNaNNaN
4sailing full1970-01-01 01:08:30.179085STOPNaNNaNNaN
2Basic activity1970-01-01 01:08:30.179085STARTNaNNaNNaN
6sailing empty1970-01-01 01:08:30.179085STARTNaNNaNNaN
2unload cargo1970-01-01 01:08:30.179085STARTNaNNaNNaN
3unload cargo1970-01-01 01:08:30.179085STOPNaNNaNNaN
3Basic activity1970-01-01 01:08:30.179085STOPNaNNaNNaN
5sailing full1970-01-01 01:08:30.179085UNKNOWN2579.3999971370.0596953.533932e+06
7sailing empty1970-01-01 01:31:20.238779STOPNaNNaNNaN
8sailing empty1970-01-01 01:31:20.238779UNKNOWN2579.3999971370.0596953.533932e+06
6sailing full1970-01-01 01:31:20.238779STARTNaNNaNNaN
5load cargo1970-01-01 01:31:20.238779STOPNaNNaNNaN
4load cargo1970-01-01 01:31:20.238779STARTNaNNaNNaN
8sailing full1970-01-01 01:54:10.298474UNKNOWN2579.3999971370.0596953.533932e+06
4unload cargo1970-01-01 01:54:10.298474STARTNaNNaNNaN
7sailing full1970-01-01 01:54:10.298474STOPNaNNaNNaN
4Basic activity1970-01-01 01:54:10.298474STARTNaNNaNNaN
5unload cargo1970-01-01 01:54:10.298474STOPNaNNaNNaN
5Basic activity1970-01-01 01:54:10.298474STOPNaNNaNNaN
\n", + "
" + ], + "text/plain": [ + " Activity Timestamp ActivityState power \\\n", + "0 sailing empty 1970-01-01 00:00:00.000000 START NaN \n", + "1 sailing empty 1970-01-01 00:00:00.000000 STOP NaN \n", + "2 sailing empty 1970-01-01 00:00:00.000000 UNKNOWN 2579.399997 \n", + "0 sailing full 1970-01-01 00:00:00.000000 START NaN \n", + "0 load cargo 1970-01-01 00:00:00.000000 START NaN \n", + "1 load cargo 1970-01-01 00:00:00.000000 STOP NaN \n", + "1 Basic activity 1970-01-01 00:22:50.059695 STOP NaN \n", + "0 Basic activity 1970-01-01 00:22:50.059695 START NaN \n", + "1 unload cargo 1970-01-01 00:22:50.059695 STOP NaN \n", + "0 unload cargo 1970-01-01 00:22:50.059695 START NaN \n", + "1 sailing full 1970-01-01 00:22:50.059695 STOP NaN \n", + "2 sailing full 1970-01-01 00:22:50.059695 UNKNOWN 2579.399997 \n", + "3 sailing empty 1970-01-01 00:22:50.059695 START NaN \n", + "3 load cargo 1970-01-01 00:45:40.119390 STOP NaN \n", + "5 sailing empty 1970-01-01 00:45:40.119390 UNKNOWN 2579.399997 \n", + "2 load cargo 1970-01-01 00:45:40.119390 START NaN \n", + "3 sailing full 1970-01-01 00:45:40.119390 START NaN \n", + "4 sailing empty 1970-01-01 00:45:40.119390 STOP NaN \n", + "4 sailing full 1970-01-01 01:08:30.179085 STOP NaN \n", + "2 Basic activity 1970-01-01 01:08:30.179085 START NaN \n", + "6 sailing empty 1970-01-01 01:08:30.179085 START NaN \n", + "2 unload cargo 1970-01-01 01:08:30.179085 START NaN \n", + "3 unload cargo 1970-01-01 01:08:30.179085 STOP NaN \n", + "3 Basic activity 1970-01-01 01:08:30.179085 STOP NaN \n", + "5 sailing full 1970-01-01 01:08:30.179085 UNKNOWN 2579.399997 \n", + "7 sailing empty 1970-01-01 01:31:20.238779 STOP NaN \n", + "8 sailing empty 1970-01-01 01:31:20.238779 UNKNOWN 2579.399997 \n", + "6 sailing full 1970-01-01 01:31:20.238779 START NaN \n", + "5 load cargo 1970-01-01 01:31:20.238779 STOP NaN \n", + "4 load cargo 1970-01-01 01:31:20.238779 START NaN \n", + "8 sailing full 1970-01-01 01:54:10.298474 UNKNOWN 2579.399997 \n", + "4 unload cargo 1970-01-01 01:54:10.298474 START NaN \n", + "7 sailing full 1970-01-01 01:54:10.298474 STOP NaN \n", + "4 Basic activity 1970-01-01 01:54:10.298474 START NaN \n", + "5 unload cargo 1970-01-01 01:54:10.298474 STOP NaN \n", + "5 Basic activity 1970-01-01 01:54:10.298474 STOP NaN \n", + "\n", + " activity_duration energy_used \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 0.000000 0.000000e+00 \n", + "0 NaN NaN \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "1 NaN NaN \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 1370.059695 3.533932e+06 \n", + "3 NaN NaN \n", + "3 NaN NaN \n", + "5 1370.059695 3.533932e+06 \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "4 NaN NaN \n", + "4 NaN NaN \n", + "2 NaN NaN \n", + "6 NaN NaN \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "3 NaN NaN \n", + "5 1370.059695 3.533932e+06 \n", + "7 NaN NaN \n", + "8 1370.059695 3.533932e+06 \n", + "6 NaN NaN \n", + "5 NaN NaN \n", + "4 NaN NaN \n", + "8 1370.059695 3.533932e+06 \n", + "4 NaN NaN \n", + "7 NaN NaN \n", + "4 NaN NaN \n", + "5 NaN NaN \n", + "5 NaN NaN " + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = pd.concat(\n", + " [\n", + " plot.get_log_dataframe(act, [while_activity, sequential_activity, *sub_processes])\n", + " for act in sub_processes\n", + " ]\n", + ").sort_values(by=['Timestamp'])\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "17669659.86372888" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df['energy_used'].sum()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "##### 5.2 Visualise gantt charts" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "linkText": "Export to plot.ly", + "plotlyServerURL": "https://plot.ly", + "showLink": false + }, + "data": [ + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(94,214,254)", + "width": 10 + }, + "mode": "lines", + "name": "While activity", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "While activity", + "While activity", + "While activity", + "While activity", + null, + "While activity", + "While activity", + "While activity", + "While activity", + null, + "While activity", + "While activity", + "While activity", + "While activity", + null, + "While activity", + "While activity", + "While activity", + "While activity", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(112,232,16)", + "width": 10 + }, + "mode": "lines", + "name": "Single run process", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null, + "Single run process", + "Single run process", + "Single run process", + "Single run process", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(130,250,34)", + "width": 10 + }, + "mode": "lines", + "name": "sailing full", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "sailing full", + "sailing full", + "sailing full", + "sailing full", + null, + "sailing full", + "sailing full", + "sailing full", + "sailing full", + null, + "sailing full", + "sailing full", + "sailing full", + "sailing full", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(148,12,52)", + "width": 10 + }, + "mode": "lines", + "name": "sailing empty", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "sailing empty", + "sailing empty", + "sailing empty", + "sailing empty", + null, + "sailing empty", + "sailing empty", + "sailing empty", + "sailing empty", + null, + "sailing empty", + "sailing empty", + "sailing empty", + "sailing empty", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(166,30,70)", + "width": 10 + }, + "mode": "lines", + "name": "unload cargo", + "type": "scatter", + "x": [ + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(184,48,88)", + "width": 10 + }, + "mode": "lines", + "name": "load cargo", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(202,66,106)", + "width": 10 + }, + "mode": "lines", + "name": "Basic activity", + "type": "scatter", + "x": [ + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "Basic activity", + "Basic activity", + "Basic activity", + "Basic activity", + null, + "Basic activity", + "Basic activity", + "Basic activity", + "Basic activity", + null, + "Basic activity", + "Basic activity", + "Basic activity", + "Basic activity", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(220,84,124)", + "width": 10 + }, + "mode": "lines", + "name": "load cargo", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(238,102,142)", + "width": 10 + }, + "mode": "lines", + "name": "unload cargo", + "type": "scatter", + "x": [ + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(0,120,160)", + "width": 10 + }, + "mode": "lines", + "name": "sailing empty", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "sailing empty", + "sailing empty", + "sailing empty", + "sailing empty", + null, + "sailing empty", + "sailing empty", + "sailing empty", + "sailing empty", + null, + "sailing empty", + "sailing empty", + "sailing empty", + "sailing empty", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(18,138,178)", + "width": 10 + }, + "mode": "lines", + "name": "load cargo", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "from_site", + "from_site", + "from_site", + "from_site", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null, + "load cargo", + "load cargo", + "load cargo", + "load cargo", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(36,156,196)", + "width": 10 + }, + "mode": "lines", + "name": "sailing full", + "type": "scatter", + "x": [ + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:00:00", + "1970-01-01T00:00:00", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:45:40.119390", + "1970-01-01T00:45:40.119390", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:31:20.238779", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "sailing full", + "sailing full", + "sailing full", + "sailing full", + null, + "sailing full", + "sailing full", + "sailing full", + "sailing full", + null, + "sailing full", + "sailing full", + "sailing full", + "sailing full", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(54,174,214)", + "width": 10 + }, + "mode": "lines", + "name": "unload cargo", + "type": "scatter", + "x": [ + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "to_site", + "to_site", + "to_site", + "to_site", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null, + "unload cargo", + "unload cargo", + "unload cargo", + "unload cargo", + null + ] + }, + { + "connectgaps": false, + "hoverinfo": "y+name", + "line": { + "color": "rgb(72,192,232)", + "width": 10 + }, + "mode": "lines", + "name": "Basic activity", + "type": "scatter", + "x": [ + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T00:22:50.059695", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:08:30.179085", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474", + "1970-01-01T01:54:10.298474" + ], + "y": [ + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "vessel01", + "vessel01", + "vessel01", + "vessel01", + null, + "Basic activity", + "Basic activity", + "Basic activity", + "Basic activity", + null, + "Basic activity", + "Basic activity", + "Basic activity", + "Basic activity", + null, + "Basic activity", + "Basic activity", + "Basic activity", + "Basic activity", + null + ] + } + ], + "layout": { + "hovermode": "closest", + "legend": { + "orientation": "h", + "x": 0, + "y": -0.2 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "GANTT Chart" + }, + "xaxis": { + "range": [ + "1970-01-01T00:00:00", + "1970-01-01T01:54:10.298474" + ], + "title": { + "font": { + "color": "#7f7f7f", + "family": "Courier New, monospace", + "size": 18 + }, + "text": "Time" + } + }, + "yaxis": { + "title": { + "font": { + "color": "#7f7f7f", + "family": "Courier New, monospace", + "size": 18 + }, + "text": "Activities" + } + } + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "objects = [while_activity, sequential_activity, vessel01, from_site, to_site]\n", + "objects.extend(sub_processes)\n", + "plot.get_gantt_chart(objects)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.10.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}