{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## model.ParallelActivity\n",
"\n",
"This notebook provides an example of OpenCLSim's __model.ParallelActivity__. The parallel activity initiate a set of __sub_processes__ simultaneously."
]
},
{
"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",
"\n",
"import openclsim.core as core\n",
"import openclsim.model as model\n",
"import openclsim.plot as plot"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 1. Initialise simpy environment"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# setup environment\n",
"simulation_start = 0\n",
"my_env = simpy.Environment(initial_time=simulation_start)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 2. Define object classes\n",
"In this example we won't use object classes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 3. Create objects\n",
"##### 3.1. Create site object(s)\n",
"No site objects are created"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### 3.2. Create vessel object(s)\n",
"No vessel objects are created"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### 3.3 Create activity/activities"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# initialise registry\n",
"registry = {}"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# create a reporting activity\n",
"reporting_activity = model.BasicActivity(\n",
" env=my_env,\n",
" name=\"Reporting activity\",\n",
" registry=registry,\n",
" duration=0,\n",
")\n",
"\n",
"# create a list of the sub processes\n",
"sub_processes = [\n",
" model.BasicActivity(\n",
" env=my_env,\n",
" name=\"Basic activity 1\",\n",
" registry=registry,\n",
" duration=14,\n",
" additional_logs=[reporting_activity],\n",
" ),\n",
" model.BasicActivity(\n",
" env=my_env,\n",
" name=\"Basic activity 2\",\n",
" registry=registry,\n",
" duration=5,\n",
" additional_logs=[reporting_activity],\n",
" ),\n",
" model.BasicActivity(\n",
" env=my_env,\n",
" name=\"Basic activity 3\",\n",
" registry=registry,\n",
" duration=220,\n",
" additional_logs=[reporting_activity],\n",
" ),\n",
"]\n",
"\n",
"# create a parallel activity\n",
"parallel_activity = model.ParallelActivity(\n",
" env= my_env,\n",
" name= \"Parallel process\",\n",
" registry= registry,\n",
" sub_processes= sub_processes,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 4. Register processes and run simpy"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# initate the simpy processes defined in the 'parallel activity' and run simpy\n",
"model.register_processes([parallel_activity, reporting_activity])\n",
"my_env.run()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 5. Inspect results\n",
"##### 5.1 Inspect logs"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Activity | \n",
" Timestamp | \n",
" ActivityState | \n",
" type | \n",
" ref | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Reporting activity | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 1 | \n",
" Reporting activity | \n",
" 1970-01-01 00:00:00 | \n",
" STOP | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 2 | \n",
" Basic activity 1 | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" additional log | \n",
" 457d9e4c-6085-4c6a-8dc6-b752953da668 | \n",
"
\n",
" \n",
" 3 | \n",
" Basic activity 2 | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" additional log | \n",
" 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 | \n",
"
\n",
" \n",
" 4 | \n",
" Basic activity 3 | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" additional log | \n",
" f55aca52-a852-4943-b52a-b163b987ff6d | \n",
"
\n",
" \n",
" 5 | \n",
" Basic activity 2 | \n",
" 1970-01-01 00:00:05 | \n",
" STOP | \n",
" additional log | \n",
" 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 | \n",
"
\n",
" \n",
" 6 | \n",
" Basic activity 1 | \n",
" 1970-01-01 00:00:14 | \n",
" STOP | \n",
" additional log | \n",
" 457d9e4c-6085-4c6a-8dc6-b752953da668 | \n",
"
\n",
" \n",
" 7 | \n",
" Basic activity 3 | \n",
" 1970-01-01 00:03:40 | \n",
" STOP | \n",
" additional log | \n",
" f55aca52-a852-4943-b52a-b163b987ff6d | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Activity Timestamp ActivityState type \\\n",
"0 Reporting activity 1970-01-01 00:00:00 START NaN \n",
"1 Reporting activity 1970-01-01 00:00:00 STOP NaN \n",
"2 Basic activity 1 1970-01-01 00:00:00 START additional log \n",
"3 Basic activity 2 1970-01-01 00:00:00 START additional log \n",
"4 Basic activity 3 1970-01-01 00:00:00 START additional log \n",
"5 Basic activity 2 1970-01-01 00:00:05 STOP additional log \n",
"6 Basic activity 1 1970-01-01 00:00:14 STOP additional log \n",
"7 Basic activity 3 1970-01-01 00:03:40 STOP additional log \n",
"\n",
" ref \n",
"0 NaN \n",
"1 NaN \n",
"2 457d9e4c-6085-4c6a-8dc6-b752953da668 \n",
"3 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 \n",
"4 f55aca52-a852-4943-b52a-b163b987ff6d \n",
"5 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 \n",
"6 457d9e4c-6085-4c6a-8dc6-b752953da668 \n",
"7 f55aca52-a852-4943-b52a-b163b987ff6d "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(plot.get_log_dataframe(reporting_activity, [*sub_processes, parallel_activity, reporting_activity]))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Activity | \n",
" Timestamp | \n",
" ActivityState | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Basic activity 1 | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
"
\n",
" \n",
" 1 | \n",
" Basic activity 1 | \n",
" 1970-01-01 00:00:14 | \n",
" STOP | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Activity Timestamp ActivityState\n",
"0 Basic activity 1 1970-01-01 00:00:00 START\n",
"1 Basic activity 1 1970-01-01 00:00:14 STOP"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Activity | \n",
" Timestamp | \n",
" ActivityState | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Basic activity 2 | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
"
\n",
" \n",
" 1 | \n",
" Basic activity 2 | \n",
" 1970-01-01 00:00:05 | \n",
" STOP | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Activity Timestamp ActivityState\n",
"0 Basic activity 2 1970-01-01 00:00:00 START\n",
"1 Basic activity 2 1970-01-01 00:00:05 STOP"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Activity | \n",
" Timestamp | \n",
" ActivityState | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Basic activity 3 | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
"
\n",
" \n",
" 1 | \n",
" Basic activity 3 | \n",
" 1970-01-01 00:03:40 | \n",
" STOP | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Activity Timestamp ActivityState\n",
"0 Basic activity 3 1970-01-01 00:00:00 START\n",
"1 Basic activity 3 1970-01-01 00:03:40 STOP"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Activity | \n",
" Timestamp | \n",
" ActivityState | \n",
" type | \n",
" ref | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" Parallel process | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
" 1 | \n",
" Parallel process | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" subprocess | \n",
" 457d9e4c-6085-4c6a-8dc6-b752953da668 | \n",
"
\n",
" \n",
" 2 | \n",
" Parallel process | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" subprocess | \n",
" 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 | \n",
"
\n",
" \n",
" 3 | \n",
" Parallel process | \n",
" 1970-01-01 00:00:00 | \n",
" START | \n",
" subprocess | \n",
" f55aca52-a852-4943-b52a-b163b987ff6d | \n",
"
\n",
" \n",
" 4 | \n",
" Parallel process | \n",
" 1970-01-01 00:00:05 | \n",
" STOP | \n",
" subprocess | \n",
" 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 | \n",
"
\n",
" \n",
" 5 | \n",
" Parallel process | \n",
" 1970-01-01 00:00:14 | \n",
" STOP | \n",
" subprocess | \n",
" 457d9e4c-6085-4c6a-8dc6-b752953da668 | \n",
"
\n",
" \n",
" 6 | \n",
" Parallel process | \n",
" 1970-01-01 00:03:40 | \n",
" STOP | \n",
" subprocess | \n",
" f55aca52-a852-4943-b52a-b163b987ff6d | \n",
"
\n",
" \n",
" 7 | \n",
" Parallel process | \n",
" 1970-01-01 00:03:40 | \n",
" STOP | \n",
" NaN | \n",
" NaN | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Activity Timestamp ActivityState type \\\n",
"0 Parallel process 1970-01-01 00:00:00 START NaN \n",
"1 Parallel process 1970-01-01 00:00:00 START subprocess \n",
"2 Parallel process 1970-01-01 00:00:00 START subprocess \n",
"3 Parallel process 1970-01-01 00:00:00 START subprocess \n",
"4 Parallel process 1970-01-01 00:00:05 STOP subprocess \n",
"5 Parallel process 1970-01-01 00:00:14 STOP subprocess \n",
"6 Parallel process 1970-01-01 00:03:40 STOP subprocess \n",
"7 Parallel process 1970-01-01 00:03:40 STOP NaN \n",
"\n",
" ref \n",
"0 NaN \n",
"1 457d9e4c-6085-4c6a-8dc6-b752953da668 \n",
"2 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 \n",
"3 f55aca52-a852-4943-b52a-b163b987ff6d \n",
"4 45f39d79-f6e1-4c3b-b5c5-1429811f5cb5 \n",
"5 457d9e4c-6085-4c6a-8dc6-b752953da668 \n",
"6 f55aca52-a852-4943-b52a-b163b987ff6d \n",
"7 NaN "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for act in [*sub_processes, parallel_activity]:\n",
" display(plot.get_log_dataframe(act, [*sub_processes, parallel_activity, reporting_activity]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### 5.2 Visualise gantt charts"
]
},
{
"cell_type": "code",
"execution_count": 8,
"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(68,246,64)",
"width": 10
},
"mode": "lines",
"name": "Parallel process",
"type": "scatter",
"x": [
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:00:05",
"1970-01-01T00:00:05",
"1970-01-01T00:00:05",
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:00:14",
"1970-01-01T00:00:14",
"1970-01-01T00:00:14",
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:03:40",
"1970-01-01T00:03:40",
"1970-01-01T00:03:40",
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:03:40",
"1970-01-01T00:03:40",
"1970-01-01T00:03:40"
],
"y": [
"Parallel process",
"Parallel process",
"Parallel process",
"Parallel process",
null,
"Parallel process",
"Parallel process",
"Parallel process",
"Parallel process",
null,
"Parallel process",
"Parallel process",
"Parallel process",
"Parallel process",
null,
"Parallel process",
"Parallel process",
"Parallel process",
"Parallel process",
null
]
},
{
"connectgaps": false,
"hoverinfo": "y+name",
"line": {
"color": "rgb(132,54,128)",
"width": 10
},
"mode": "lines",
"name": "Basic activity 1",
"type": "scatter",
"x": [
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:00:14",
"1970-01-01T00:00:14",
"1970-01-01T00:00:14"
],
"y": [
"Basic activity 1",
"Basic activity 1",
"Basic activity 1",
"Basic activity 1",
null
]
},
{
"connectgaps": false,
"hoverinfo": "y+name",
"line": {
"color": "rgb(196,118,192)",
"width": 10
},
"mode": "lines",
"name": "Basic activity 2",
"type": "scatter",
"x": [
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:00:05",
"1970-01-01T00:00:05",
"1970-01-01T00:00:05"
],
"y": [
"Basic activity 2",
"Basic activity 2",
"Basic activity 2",
"Basic activity 2",
null
]
},
{
"connectgaps": false,
"hoverinfo": "y+name",
"line": {
"color": "rgb(4,182,0)",
"width": 10
},
"mode": "lines",
"name": "Basic activity 3",
"type": "scatter",
"x": [
"1970-01-01T00:00:00",
"1970-01-01T00:00:00",
"1970-01-01T00:03:40",
"1970-01-01T00:03:40",
"1970-01-01T00:03:40"
],
"y": [
"Basic activity 3",
"Basic activity 3",
"Basic activity 3",
"Basic activity 3",
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
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
}
},
"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": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"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
},
"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-01T00:03:40"
],
"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": [
"plot.get_gantt_chart([parallel_activity, *sub_processes])"
]
}
],
"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.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 4
}