{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Basic Agent Sudy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It is recommended to have a look at the [0_basic_functionalities](0_basic_functionalities.ipynb), [1_Observation_Agents](1_Observation_Agents.ipynb), [2_Action_GridManipulation](3_TrainingAnAgent.ipynb) and [3_TrainingAnAgent](3_TrainingAnAgent.ipynb) notebooks before getting into this one." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Objectives**\n", "\n", "In this notebook we will expose how to study an Agent. For this notebook to be interested, we first use a dummy agent, and then we look at how to study its behaviour from the file saved.\n", "\n", "This notebook will also show you how to use the Graphical User Interface built for analyzing grid2Op agents called \"Grid2Viz\".\n", "\n", "It is more than recommended to know how to define an Agent and use a Runner before doing this tutotial!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Evaluate the performance of a simple Agent" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "import sys\n", "import grid2op\n", "import copy\n", "import numpy as np\n", "import shutil\n", "import plotly.graph_objects as go\n", "\n", "from tqdm.notebook import tqdm\n", "from grid2op.Agent import PowerLineSwitch\n", "from grid2op.Reward import L2RPNReward\n", "from grid2op.Runner import Runner\n", "from grid2op.Chronics import GridStateFromFileWithForecasts, Multifolder\n", "path_agents = \"study_agent_getting_started\"\n", "max_iter = 30" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the next cell we evaluate the agent \"PowerLineSwitch\" and save the results of this evaluation in \"study_agent_getting_started\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/benjamin/Documents/grid2op_dev/getting_started/grid2op/MakeEnv/Make.py:224: UserWarning:\n", "\n", "You are using a development environment. This environment is not intended for training agents.\n", "\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "fe4bcc2880e847f6900c93ea04a13a08", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(FloatProgress(value=0.0, description='episode', max=2.0, style=ProgressStyle(description_width=…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "a7b1ee10da754a14b20b6f721d378709", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(FloatProgress(value=0.0, description='episode', max=30.0, style=ProgressStyle(description_width…" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "bcbb9ace133446fdaf83f2f8c87a679d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "HBox(children=(FloatProgress(value=0.0, description='episode', max=30.0, style=ProgressStyle(description_width…" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "The results for the evaluated agent are:\n", "\tFor chronics with id 000\n", "\t\t - cumulative reward: 496.772949\n", "\t\t - number of time steps completed: 30 / 30\n", "\tFor chronics with id 001\n", "\t\t - cumulative reward: 515.620117\n", "\t\t - number of time steps completed: 30 / 30\n" ] } ], "source": [ "scoring_function = L2RPNReward\n", "env = grid2op.make(reward_class=L2RPNReward, test=True)\n", "# env.chronics_handler.set_max_iter(max_iter)\n", "shutil.rmtree(os.path.abspath(path_agents), ignore_errors=True)\n", "if not os.path.exists(path_agents):\n", " os.mkdir(path_agents)\n", "\n", "# make a runner for this agent\n", "path_agent = os.path.join(path_agents, \"PowerLineSwitch\")\n", "shutil.rmtree(os.path.abspath(path_agent), ignore_errors=True)\n", "\n", "runner = Runner(**env.get_params_for_runner(),\n", " agentClass=PowerLineSwitch\n", " )\n", "res = runner.run(path_save=path_agent, nb_episode=2, \n", " max_iter=max_iter,\n", " pbar=tqdm)\n", "print(\"The results for the evaluated agent are:\")\n", "for _, chron_id, cum_reward, nb_time_step, max_ts in res:\n", " msg_tmp = \"\\tFor chronics with id {}\\n\".format(chron_id)\n", " msg_tmp += \"\\t\\t - cumulative reward: {:.6f}\\n\".format(cum_reward)\n", " msg_tmp += \"\\t\\t - number of time steps completed: {:.0f} / {:.0f}\".format(nb_time_step, max_ts)\n", " print(msg_tmp)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Looking at the results, understand the behaviour of the Agent" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The content of the folder is the following:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['000',\n", " 'dict_env_modification_space.json',\n", " '001',\n", " 'dict_action_space.json',\n", " 'dict_observation_space.json']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "os.listdir(path_agent)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "000 dict_action_space.json\t dict_observation_space.json\r\n", "001 dict_env_modification_space.json\r\n" ] } ], "source": [ "!ls $path_agent" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can load the data corresponding to episode 1 for example, we can load the actions and the observations and de-serialize them properly into proper objects. This is now automatically done with the class \"EpisodeData\" that can be used as follow:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from grid2op.Episode import EpisodeData\n", "episode_studied = \"001\"\n", "this_episode = EpisodeData.from_disk(path_agent, episode_studied)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Inspect the actions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And now we can start to study the given agent, for example, let's inspect its actions and wonder how many powerlines it has disconnected (for example, this is probably not the best thing to do here...)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "line_disc = 0\n", "line_reco = 0\n", "for act in this_episode.actions:\n", " dict_ = act.as_dict() # representation of an action as a dictionnary, see the documentation for more information\n", " if \"change_line_status\" in dict_:\n", " if \"set_bus_vect\" in dict_:\n", " line_reco += 1\n", " else:\n", " line_disc += 1\n", "line_disc" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also wonder how many times this Agent acted on the powerline with id $14$, and inspect how many times it has change its status:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id_line_inspected = 13\n", "line_disconnected = 0\n", "for act in this_episode.actions:\n", " dict_ = act.effect_on(line_id=id_line_inspected) # which effect has this action action on the substation with given id\n", " # other objects are: load_id, gen_id, line_id or substation_id\n", " if dict_['change_line_status'] or dict_[\"set_line_status\"] != 0:\n", " line_disconnected += 1\n", "line_disconnected" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Inspect the modification of the environment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example, we might want to inspect the number of hazards and maintenance of a total scenario, to see how difficult it was." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nb_hazards = 0\n", "nb_maintenance = 0\n", "for act in this_episode.env_actions:\n", " dict_ = act.as_dict() # representation of an action as a dictionnary, see the documentation for more information\n", " if \"nb_hazards\" in dict_:\n", " nb_hazards += 1\n", " if \"nb_maintenance\" in dict_:\n", " nb_maintenance += 1\n", "nb_maintenance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Inspect the observations" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example, let's look at the value consumed by load 1. For this cell to work, it requires plotly for displaying the results." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "type": "scatter", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ], "y": [ 87.4000015258789, 85.80000305175781, 87.0999984741211, 87.80000305175781, 86.9000015258789, 86.5999984741211, 85.19999694824219, 85.4000015258789, 83.4000015258789, 85.30000305175781, 82.69999694824219, 82.69999694824219, 83.30000305175781, 81.19999694824219, 82.19999694824219, 82.19999694824219, 81.30000305175781, 82.5999984741211, 82.4000015258789, 82.9000015258789, 81.5999984741211, 82.30000305175781, 82.5, 81.4000015258789, 83.0999984741211, 81.5999984741211, 81.5, 80.9000015258789, 80.9000015258789, 80.9000015258789, 80.80000305175781 ] } ], "layout": { "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": "Consumption of load 1" }, "xaxis": { "title": { "text": "Time step" } }, "yaxis": { "title": { "text": "Load (MW)" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "load_id = 1\n", "# extract the data\n", "val_load1 = np.zeros(len(this_episode.observations))\n", "for i, obs in enumerate(this_episode.observations):\n", " dict_ = obs.state_of(load_id=load_id) # which effect has this action action on the substation with id 1\n", " # other objects are: load_id, gen_id, line_id or substation_id\n", " # see the documentation for more information.\n", " val_load1[i] = dict_['p']\n", "\n", "# plot it\n", "fig = go.Figure(data=[go.Scatter(x=[i for i in range(len(val_load1))],\n", " y=val_load1)])\n", "fig.update_layout(title=\"Consumption of load {}\".format(load_id),\n", " xaxis_title=\"Time step\",\n", " yaxis_title=\"Load (MW)\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or the values of generator 3 (it's supposed to represent a solar energy source)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "type": "scatter", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ], "y": [ 75.57899475097656, 70.84699249267578, 76.95658111572266, 71.31451416015625, 74.5802993774414, 73.71126556396484, 73.32105255126953, 74.3460693359375, 72.1780014038086, 72.5805892944336, 69.57157135009766, 69.16791534423828, 71.35700225830078, 66.82980346679688, 69.03186798095703, 68.57644653320312, 70.34136962890625, 69.5180435180664, 71.44571685791016, 71.57627868652344, 68.18572998046875, 67.8351058959961, 73.4782485961914, 69.13489532470703, 71.38349914550781, 69.9678955078125, 69.21878814697266, 68.79898834228516, 68.91580963134766, 70.41966247558594, 67.74209594726562 ] } ], "layout": { "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": "Production of generator 4" }, "xaxis": { "title": { "text": "Time step" } }, "yaxis": { "title": { "text": "Production (MW)" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "gen_id = 4\n", "# extract the data\n", "val_lgen3 = np.zeros(len(this_episode.observations))\n", "for i, obs in enumerate(this_episode.observations):\n", " dict_ = obs.state_of(gen_id=gen_id) # which effect has this action action on the substation with id 1\n", " # other objects are: load_id, gen_id, line_id or substation_id\n", " # see the documentation for more information.\n", " val_lgen3[i] = dict_['p']\n", "\n", "# plot it\n", "fig = go.Figure(data=[go.Scatter(x=[i for i in range(len(val_lgen3))],\n", " y=val_lgen3)])\n", "fig.update_layout(title=\"Production of generator {}\".format(gen_id),\n", " xaxis_title=\"Time step\",\n", " yaxis_title=\"Production (MW)\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the same fashion, we might want to get the flows on powerline connecting bus 3 to bus 4 (without knowing its id by using the appropriate method of the observation_space):" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "type": "scatter", "x": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ], "y": [ 138.4017333984375, 63.16057586669922, 66.07588195800781, 63.77981185913086, 67.49466705322266, 65.87721252441406, 63.96355056762695, 66.580810546875, 63.66123580932617, 64.71082305908203, 60.87654495239258, 61.75203323364258, 65.40937805175781, 59.579078674316406, 62.486175537109375, 63.288265228271484, 63.65131378173828, 63.36322784423828, 64.97779846191406, 63.92928695678711, 60.64645767211914, 61.25659942626953, 65.1127700805664, 61.552978515625, 64.09252166748047, 64.59538269042969, 63.22343444824219, 61.05244064331055, 61.639495849609375, 63.5041389465332, 62.40955352783203 ] } ], "layout": { "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": "Flow on powerline 6 (going from 3 to 4)" }, "xaxis": { "title": { "text": "Time step" } }, "yaxis": { "title": { "text": "Production (MW)" } } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from_ = 3\n", "to_ = 4\n", "found_ids = this_episode.observations.helper.get_lines_id(from_=from_, to_=to_)\n", "line_id = found_ids[0]\n", "\n", "# extract the data\n", "val_l3_4 = np.zeros(len(this_episode.observations))\n", "for i, obs in enumerate(this_episode.observations):\n", " dict_ = obs.state_of(line_id=line_id) # which effect has this action action on the substation with id 1\n", " # other objects are: load_id, gen_id, line_id or substation_id\n", " # see the documentation for more information.\n", " val_l3_4[i] = dict_[\"origin\"]['a']\n", "\n", "# plot it\n", "fig = go.Figure(data=[go.Scatter(x=[i for i in range(len(val_l3_4))],\n", " y=val_l3_4)])\n", "fig.update_layout(title=\"Flow on powerline {} (going from {} to {})\".format(line_id, from_, to_),\n", " xaxis_title=\"Time step\",\n", " yaxis_title=\"Production (MW)\")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Quick display of a grid using an observation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Bellow you can find an example on how to plot a observation and the underlying powergrid. This is an example, the results doesn't look really great. It uses plotly and requires the layout of the grid (eg the coordinates of the substations) to be specified.\n", "\n", "Note also that this code is not optimized at all." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "mode": "text", "name": "line_0_1", "showlegend": false, "text": [ "0.3 %" ], "textposition": "top right", "type": "scatter", "x": [ -188.55172413793105 ], "y": [ -174.1206896551724 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(33,113,181)" }, "name": "aline_0_1", "showlegend": false, "type": "scatter", "x": [ -280, -100 ], "y": [ -81, -270 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_0_1", "showlegend": false, "type": "scatter", "x": [ -269.6551724137931 ], "y": [ -91.86206896551724 ] }, { "hoverinfo": "skip", "marker": { "color": "lime", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_0_1", "showlegend": false, "type": "scatter", "x": [ -110.34482758620689 ], "y": [ -259.13793103448273 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(33,113,181)", "showscale": false, "size": 10, "symbol": "triangle-se" }, "name": "a_->_line_0_1", "showlegend": false, "type": "scatter", "x": [ -255.86206896551727, -259.3103448275862 ], "y": [ -106.34482758620689, -102.72413793103448 ] }, { "mode": "text", "name": "line_0_4", "showlegend": false, "text": [ "0.44 %" ], "textposition": "top left", "type": "scatter", "x": [ -172.2480694691784 ], "y": [ -65.51544424657267 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(66,146,198)" }, "name": "aline_0_4", "showlegend": false, "type": "scatter", "x": [ -280, -64 ], "y": [ -81, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_0_4", "showlegend": false, "type": "scatter", "x": [ -265.115831849295 ], "y": [ -79.13947898116187 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_0_4", "showlegend": false, "type": "scatter", "x": [ -78.88416815070502 ], "y": [ -55.86052101883813 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(66,146,198)", "showscale": false, "size": 10, "symbol": "triangle-right" }, "name": "a_->_line_0_4", "showlegend": false, "type": "scatter", "x": [ -245.27027431502162, -250.23166369858995 ], "y": [ -76.6587842893777, -77.27895796232374 ] }, { "mode": "text", "name": "line_1_2", "showlegend": false, "text": [ "0.32 %" ], "textposition": "top right", "type": "scatter", "x": [ 133 ], "y": [ -268 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(33,113,181)" }, "name": "aline_1_2", "showlegend": false, "type": "scatter", "x": [ -100, 366 ], "y": [ -270, -270 ] }, { "hoverinfo": "skip", "marker": { "color": "lime", "showscale": false, "size": 12 }, "name": "a_bus__or_line_1_2", "showlegend": false, "type": "scatter", "x": [ -85 ], "y": [ -270 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_1_2", "showlegend": false, "type": "scatter", "x": [ 351 ], "y": [ -270 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(33,113,181)", "showscale": false, "size": 10, "symbol": "triangle-right" }, "name": "a_->_line_1_2", "showlegend": false, "type": "scatter", "x": [ -65, -70 ], "y": [ -270, -270 ] }, { "mode": "text", "name": "line_1_3", "showlegend": false, "text": [ "0.5 %" ], "textposition": "top left", "type": "scatter", "x": [ 132.1589216120904 ], "y": [ -160.1854512557136 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(66,146,198)" }, "name": "aline_1_3", "showlegend": false, "type": "scatter", "x": [ -100, 366 ], "y": [ -270, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_1_3", "showlegend": false, "type": "scatter", "x": [ -86.39088441785186 ], "y": [ -263.6919120906781 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_1_3", "showlegend": false, "type": "scatter", "x": [ 352.39088441785185 ], "y": [ -60.308087909321884 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(66,146,198)", "showscale": false, "size": 10, "symbol": "triangle-ne" }, "name": "a_->_line_1_3", "showlegend": false, "type": "scatter", "x": [ -68.24539697498768, -72.78176883570373 ], "y": [ -255.2811282115823, -257.38382418135626 ] }, { "mode": "text", "name": "line_1_4", "showlegend": false, "text": [ "0.0 %" ], "textposition": "top left", "type": "scatter", "x": [ -83.97278784766429 ], "y": [ -161.67120202538928 ] }, { "hoverinfo": "skip", "line": { "color": "black", "dash": "dash" }, "name": "aline_1_4", "showlegend": false, "type": "scatter", "x": [ -100, -64 ], "y": [ -270, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_1_4", "showlegend": false, "type": "scatter", "x": [ -97.53401519041964 ], "y": [ -255.20409114251785 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_1_4", "showlegend": false, "type": "scatter", "x": [ -66.46598480958036 ], "y": [ -68.79590885748216 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 10, "symbol": "triangle-up" }, "name": "a_->_line_1_4", "showlegend": false, "type": "scatter", "x": [ -94.24603544431248, -95.06803038083928 ], "y": [ -235.47621266587495, -240.40818228503568 ] }, { "mode": "text", "name": "line_2_3", "showlegend": false, "text": [ "0.19 %" ], "textposition": "top left", "type": "scatter", "x": [ 364 ], "y": [ -162 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(8,81,156)" }, "name": "aline_2_3", "showlegend": false, "type": "scatter", "x": [ 366, 366 ], "y": [ -270, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_2_3", "showlegend": false, "type": "scatter", "x": [ 366 ], "y": [ -255 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_2_3", "showlegend": false, "type": "scatter", "x": [ 366 ], "y": [ -69 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(8,81,156)", "showscale": false, "size": 10, "symbol": "triangle-up" }, "name": "a_->_line_2_3", "showlegend": false, "type": "scatter", "x": [ 366, 366 ], "y": [ -235, -240 ] }, { "mode": "text", "name": "line_3_4", "showlegend": false, "text": [ "0.16 %" ], "textposition": "bottom right", "type": "scatter", "x": [ 151 ], "y": [ -56 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(8,81,156)" }, "name": "aline_3_4", "showlegend": false, "type": "scatter", "x": [ 366, -64 ], "y": [ -54, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_3_4", "showlegend": false, "type": "scatter", "x": [ 351 ], "y": [ -54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_3_4", "showlegend": false, "type": "scatter", "x": [ -49 ], "y": [ -54 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(8,81,156)", "showscale": false, "size": 10, "symbol": "triangle-right" }, "name": "a_->_line_3_4", "showlegend": false, "type": "scatter", "x": [ 331, 336 ], "y": [ -54, -54 ] }, { "mode": "text", "name": "line_5_10", "showlegend": false, "text": [ "0.34 %" ], "textposition": "top left", "type": "scatter", "x": [ 6.294649613437622 ], "y": [ 109.5959731970224 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(33,113,181)" }, "name": "aline_5_10", "showlegend": false, "type": "scatter", "x": [ -64, 79 ], "y": [ 54, 162 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_5_10", "showlegend": false, "type": "scatter", "x": [ -52.03020102233194 ], "y": [ 63.040127899217836 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_5_10", "showlegend": false, "type": "scatter", "x": [ 67.03020102233194 ], "y": [ 152.95987210078218 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(33,113,181)", "showscale": false, "size": 10, "symbol": "triangle-ne" }, "name": "a_->_line_5_10", "showlegend": false, "type": "scatter", "x": [ -36.07046905210786, -40.06040204466388 ], "y": [ 75.09363176484162, 72.08025579843567 ] }, { "mode": "text", "name": "line_5_11", "showlegend": false, "text": [ "0.34 %" ], "textposition": "bottom left", "type": "scatter", "x": [ -118.79545477404574 ], "y": [ 161.1188971942183 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(33,113,181)" }, "name": "aline_5_11", "showlegend": false, "type": "scatter", "x": [ -64, -170 ], "y": [ 54, 270 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_5_11", "showlegend": false, "type": "scatter", "x": [ -70.60827104336276 ], "y": [ 67.46591080534299 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_5_11", "showlegend": false, "type": "scatter", "x": [ -163.39172895663722 ], "y": [ 256.534089194657 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(33,113,181)", "showscale": false, "size": 10, "symbol": "triangle-nw" }, "name": "a_->_line_5_11", "showlegend": false, "type": "scatter", "x": [ -79.41929910117977, -77.21654208672552 ], "y": [ 85.42045854580032, 80.93182161068599 ] }, { "mode": "text", "name": "line_5_12", "showlegend": false, "text": [ "0.84 %" ], "textposition": "top left", "type": "scatter", "x": [ -66 ], "y": [ 162 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(241,105,19)" }, "name": "aline_5_12", "showlegend": false, "type": "scatter", "x": [ -64, -64 ], "y": [ 54, 270 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_5_12", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ 69 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_5_12", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ 255 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(241,105,19)", "showscale": false, "size": 10, "symbol": "triangle-up" }, "name": "a_->_line_5_12", "showlegend": false, "type": "scatter", "x": [ -64, -64 ], "y": [ 89, 84 ] }, { "mode": "text", "name": "line_8_9", "showlegend": false, "text": [ "0.0 %" ], "textposition": "bottom left", "type": "scatter", "x": [ 273.0783694587059 ], "y": [ 79.22500784639652 ] }, { "hoverinfo": "skip", "line": { "color": "black", "dash": "dash" }, "name": "aline_8_9", "showlegend": false, "type": "scatter", "x": [ 326, 222 ], "y": [ 54, 108 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 12 }, "name": "a_bus__or_line_8_9", "showlegend": false, "type": "scatter", "x": [ 312.6875588479739 ], "y": [ 60.91222905970586 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_8_9", "showlegend": false, "type": "scatter", "x": [ 235.3124411520261 ], "y": [ 101.08777094029415 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 10, "symbol": "triangle-nw" }, "name": "a_->_line_8_9", "showlegend": false, "type": "scatter", "x": [ 294.93763731193906, 299.3751176959478 ], "y": [ 70.128534472647, 67.82445811941172 ] }, { "mode": "text", "name": "line_8_13", "showlegend": false, "text": [ "0.44 %" ], "textposition": "bottom left", "type": "scatter", "x": [ 272.3169682740335 ], "y": [ 133.9195351882684 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(66,146,198)" }, "name": "aline_8_13", "showlegend": false, "type": "scatter", "x": [ 326, 222 ], "y": [ 54, 216 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_8_13", "showlegend": false, "type": "scatter", "x": [ 317.89651391201306 ], "y": [ 66.62273794474885 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_8_13", "showlegend": false, "type": "scatter", "x": [ 230.1034860879869 ], "y": [ 203.37726205525115 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(66,146,198)", "showscale": false, "size": 10, "symbol": "triangle-nw" }, "name": "a_->_line_8_13", "showlegend": false, "type": "scatter", "x": [ 307.0918657946972, 309.7930278240262 ], "y": [ 83.45305520441399, 79.2454758894977 ] }, { "mode": "text", "name": "line_9_10", "showlegend": false, "text": [ "0.35 %" ], "textposition": "bottom left", "type": "scatter", "x": [ 149.7934533154708 ], "y": [ 133.12895970578376 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(33,113,181)" }, "name": "aline_9_10", "showlegend": false, "type": "scatter", "x": [ 222, 79 ], "y": [ 108, 162 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_9_10", "showlegend": false, "type": "scatter", "x": [ 207.96719779337823 ], "y": [ 113.29910013396906 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_9_10", "showlegend": false, "type": "scatter", "x": [ 93.03280220662178 ], "y": [ 156.70089986603094 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(33,113,181)", "showscale": false, "size": 10, "symbol": "triangle-se" }, "name": "a_->_line_9_10", "showlegend": false, "type": "scatter", "x": [ 189.25679485121586, 193.93439558675644 ], "y": [ 120.36456697926114, 118.59820026793813 ] }, { "mode": "text", "name": "line_11_12", "showlegend": false, "text": [ "0.0 %" ], "textposition": "top right", "type": "scatter", "x": [ -117 ], "y": [ 272 ] }, { "hoverinfo": "skip", "line": { "color": "black", "dash": "dash" }, "name": "aline_11_12", "showlegend": false, "type": "scatter", "x": [ -170, -64 ], "y": [ 270, 270 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 12 }, "name": "a_bus__or_line_11_12", "showlegend": false, "type": "scatter", "x": [ -155 ], "y": [ 270 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_11_12", "showlegend": false, "type": "scatter", "x": [ -79 ], "y": [ 270 ] }, { "hoverinfo": "skip", "marker": { "color": "black", "showscale": false, "size": 10, "symbol": "triangle-right" }, "name": "a_->_line_11_12", "showlegend": false, "type": "scatter", "x": [ -135, -140 ], "y": [ 270, 270 ] }, { "mode": "text", "name": "line_12_13", "showlegend": false, "text": [ "0.37 %" ], "textposition": "top right", "type": "scatter", "x": [ 79.3710661069381 ], "y": [ 244.96527604785734 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(33,113,181)" }, "name": "aline_12_13", "showlegend": false, "type": "scatter", "x": [ -64, 222 ], "y": [ 270, 216 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_12_13", "showlegend": false, "type": "scatter", "x": [ -49.26042964106988 ], "y": [ 267.21700419796423 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_12_13", "showlegend": false, "type": "scatter", "x": [ 207.2604296410699 ], "y": [ 218.78299580203577 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(33,113,181)", "showscale": false, "size": 10, "symbol": "triangle-right" }, "name": "a_->_line_12_13", "showlegend": false, "type": "scatter", "x": [ -29.607669162496386, -34.52085928213976 ], "y": [ 263.5063431285832, 264.43400839592846 ] }, { "mode": "text", "name": "line_3_6", "showlegend": false, "text": [ "0.28 %" ], "textposition": "top left", "type": "scatter", "x": [ 406.918484817373 ], "y": [ -25.317643049246893 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(8,81,156)" }, "name": "aline_3_6", "showlegend": false, "type": "scatter", "x": [ 366, 450 ], "y": [ -54, 0 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_3_6", "showlegend": false, "type": "scatter", "x": [ 378.6176771306483 ], "y": [ -45.88863613029752 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_3_6", "showlegend": false, "type": "scatter", "x": [ 437.3823228693517 ], "y": [ -8.111363869702481 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(8,81,156)", "showscale": false, "size": 10, "symbol": "triangle-ne" }, "name": "a_->_line_3_6", "showlegend": false, "type": "scatter", "x": [ 395.4412466381794, 391.2353542612966 ], "y": [ -35.073484304027545, -37.77727226059504 ] }, { "mode": "text", "name": "line_3_8", "showlegend": false, "text": [ "0.22 %" ], "textposition": "bottom left", "type": "scatter", "x": [ 344.1245024785526 ], "y": [ -0.6946287116471879 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(8,81,156)" }, "name": "aline_3_8", "showlegend": false, "type": "scatter", "x": [ 366, 326 ], "y": [ -54, 54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_3_8", "showlegend": false, "type": "scatter", "x": [ 360.7902846626461 ], "y": [ -39.93376858914445 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_3_8", "showlegend": false, "type": "scatter", "x": [ 331.2097153373539 ], "y": [ 39.93376858914445 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(8,81,156)", "showscale": false, "size": 10, "symbol": "triangle-nw" }, "name": "a_->_line_3_8", "showlegend": false, "type": "scatter", "x": [ 353.8439975461742, 355.5805693252922 ], "y": [ -21.178793374670374, -25.86753717828889 ] }, { "mode": "text", "name": "line_4_5", "showlegend": false, "text": [ "0.52 %" ], "textposition": "top left", "type": "scatter", "x": [ -66 ], "y": [ 0 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(66,146,198)" }, "name": "aline_4_5", "showlegend": false, "type": "scatter", "x": [ -64, -64 ], "y": [ -54, 54 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_4_5", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ -39 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_4_5", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ 39 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(66,146,198)", "showscale": false, "size": 10, "symbol": "triangle-up" }, "name": "a_->_line_4_5", "showlegend": false, "type": "scatter", "x": [ -64, -64 ], "y": [ -19, -24 ] }, { "mode": "text", "name": "line_6_7", "showlegend": false, "text": [ "0.27 %" ], "textposition": "top right", "type": "scatter", "x": [ 500 ], "y": [ 2 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(8,81,156)" }, "name": "aline_6_7", "showlegend": false, "type": "scatter", "x": [ 450, 550 ], "y": [ 0, 0 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_6_7", "showlegend": false, "type": "scatter", "x": [ 465 ], "y": [ 0 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_6_7", "showlegend": false, "type": "scatter", "x": [ 535 ], "y": [ 0 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(8,81,156)", "showscale": false, "size": 10, "symbol": "triangle-left" }, "name": "a_->_line_6_7", "showlegend": false, "type": "scatter", "x": [ 485, 480 ], "y": [ 0, 0 ] }, { "mode": "text", "name": "line_8_6", "showlegend": false, "text": [ "0.18 %" ], "textposition": "top right", "type": "scatter", "x": [ 388.7985335345599 ], "y": [ 28.833669597878323 ] }, { "hoverinfo": "skip", "line": { "color": "rgb(8,81,156)" }, "name": "aline_8_6", "showlegend": false, "type": "scatter", "x": [ 326, 450 ], "y": [ 54, 0 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__or_line_8_6", "showlegend": false, "type": "scatter", "x": [ 339.7525219840874 ], "y": [ 48.01099849080064 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "a_bus__ex_line_8_6", "showlegend": false, "type": "scatter", "x": [ 436.2474780159126 ], "y": [ 5.98900150919936 ] }, { "hoverinfo": "skip", "marker": { "color": "rgb(8,81,156)", "showscale": false, "size": 10, "symbol": "triangle-nw" }, "name": "a_->_line_8_6", "showlegend": false, "type": "scatter", "x": [ 358.08921796287063, 353.50504396817485 ], "y": [ 40.02566314520149, 42.021996981601276 ] }, { "mode": "text", "name": "load_1_0", "showlegend": false, "text": [ "load_1_0
-20.8 MW" ], "textposition": "bottom left", "type": "scatter", "x": [ -146.63580168787894 ], "y": [ -310.9485087991132 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -141, -100 ], "y": [ -306, -270 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_1_0", "showlegend": false, "type": "scatter", "x": [ -141 ], "y": [ -306 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_1_0", "showlegend": false, "type": "scatter", "x": [ -111.27160337575788 ], "y": [ -279.89701759822645 ] }, { "mode": "text", "name": "load_2_1", "showlegend": false, "text": [ "load_2_1
-80.8 MW" ], "textposition": "bottom right", "type": "scatter", "x": [ 366 ], "y": [ -330.5 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 366, 366 ], "y": [ -323, -270 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_2_1", "showlegend": false, "type": "scatter", "x": [ 366 ], "y": [ -323 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_2_1", "showlegend": false, "type": "scatter", "x": [ 366 ], "y": [ -285 ] }, { "mode": "text", "name": "load_3_2", "showlegend": false, "text": [ "load_3_2
-43.0 MW" ], "textposition": "bottom right", "type": "scatter", "x": [ 404.0679347138801 ], "y": [ -95.52865605150556 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 399, 366 ], "y": [ -90, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_3_2", "showlegend": false, "type": "scatter", "x": [ 399 ], "y": [ -90 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_3_2", "showlegend": false, "type": "scatter", "x": [ 376.1358694277602 ], "y": [ -65.05731210301113 ] }, { "mode": "text", "name": "load_4_3", "showlegend": false, "text": [ "load_4_3
-6.3 MW" ], "textposition": "bottom left", "type": "scatter", "x": [ -92.97499205002384 ], "y": [ -100.35998728003815 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -89, -64 ], "y": [ -94, -54 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_4_3", "showlegend": false, "type": "scatter", "x": [ -89 ], "y": [ -94 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_4_3", "showlegend": false, "type": "scatter", "x": [ -71.9499841000477 ], "y": [ -66.71997456007632 ] }, { "mode": "text", "name": "load_5_4", "showlegend": false, "text": [ "load_5_4
-10.6 MW" ], "textposition": "top left", "type": "scatter", "x": [ -103.3033008588991 ], "y": [ 93.3033008588991 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -98, -64 ], "y": [ 88, 54 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_5_4", "showlegend": false, "type": "scatter", "x": [ -98 ], "y": [ 88 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_5_4", "showlegend": false, "type": "scatter", "x": [ -74.60660171779821 ], "y": [ 64.60660171779821 ] }, { "mode": "text", "name": "load_8_5", "showlegend": false, "text": [ "load_8_5
-28.1 MW" ], "textposition": "top right", "type": "scatter", "x": [ 375.5489827651118 ], "y": [ 81.65524619448102 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 369, 326 ], "y": [ 78, 54 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_8_5", "showlegend": false, "type": "scatter", "x": [ 369 ], "y": [ 78 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_8_5", "showlegend": false, "type": "scatter", "x": [ 339.0979655302237 ], "y": [ 61.31049238896206 ] }, { "mode": "text", "name": "load_9_6", "showlegend": false, "text": [ "load_9_6
-7.9 MW" ], "textposition": "top right", "type": "scatter", "x": [ 259.6443252103016 ], "y": [ 140.9387845590139 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 254, 222 ], "y": [ 136, 108 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_9_6", "showlegend": false, "type": "scatter", "x": [ 254 ], "y": [ 136 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_9_6", "showlegend": false, "type": "scatter", "x": [ 233.28865042060318 ], "y": [ 117.87756911802776 ] }, { "mode": "text", "name": "load_10_7", "showlegend": false, "text": [ "load_10_7
-3.1 MW" ], "textposition": "top left", "type": "scatter", "x": [ 73.18955614423686 ], "y": [ 215.45608347302093 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 74, 79 ], "y": [ 208, 162 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_10_7", "showlegend": false, "type": "scatter", "x": [ 74 ], "y": [ 208 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_10_7", "showlegend": false, "type": "scatter", "x": [ 77.3791122884737 ], "y": [ 176.91216694604185 ] }, { "mode": "text", "name": "load_11_8", "showlegend": false, "text": [ "load_11_8
-4.8 MW" ], "textposition": "top left", "type": "scatter", "x": [ -219.86950790631735 ], "y": [ 309.66892674366153 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -214, -170 ], "y": [ 305, 270 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_11_8", "showlegend": false, "type": "scatter", "x": [ -214 ], "y": [ 305 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_11_8", "showlegend": false, "type": "scatter", "x": [ -181.73901581263473 ], "y": [ 279.33785348732306 ] }, { "mode": "text", "name": "load_12_9", "showlegend": false, "text": [ "load_12_9
-11.1 MW" ], "textposition": "top left", "type": "scatter", "x": [ -77.65619239448347 ], "y": [ 330.314849742302 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -76, -64 ], "y": [ 323, 270 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_12_9", "showlegend": false, "type": "scatter", "x": [ -76 ], "y": [ 323 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_12_9", "showlegend": false, "type": "scatter", "x": [ -67.31238478896692 ], "y": [ 284.6296994846039 ] }, { "mode": "text", "name": "load_13_10", "showlegend": false, "text": [ "load_13_10
-13.3 MW" ], "textposition": "top right", "type": "scatter", "x": [ 246.92229993127523 ], "y": [ 274.9072543830142 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 244, 222 ], "y": [ 268, 216 ] }, { "hoverinfo": "skip", "marker": { "color": "DarkOrange", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "cload_13_10", "showlegend": false, "type": "scatter", "x": [ 244 ], "y": [ 268 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "c_bus_load_13_10", "showlegend": false, "type": "scatter", "x": [ 227.84459986255047 ], "y": [ 229.81450876602838 ] }, { "mode": "text", "name": "gen_1_0", "showlegend": false, "text": [ "gen_1_0
70.5 MW" ], "textposition": "bottom right", "type": "scatter", "x": [ -96.57615015983008 ], "y": [ -330.4880138430019 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -97, -100 ], "y": [ -323, -270 ] }, { "hoverinfo": "skip", "marker": { "color": "LightGreen", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "bgen_1_0", "showlegend": false, "type": "scatter", "x": [ -97 ], "y": [ -323 ] }, { "hoverinfo": "skip", "marker": { "color": "lime", "showscale": false, "size": 12 }, "name": "b_bus_gen_1_0", "showlegend": false, "type": "scatter", "x": [ -99.15230031966016 ], "y": [ -284.97602768600376 ] }, { "mode": "text", "name": "gen_2_1", "showlegend": false, "text": [ "gen_2_1
68.4 MW" ], "textposition": "bottom right", "type": "scatter", "x": [ 414.94981994567706 ], "y": [ -307.56614088854286 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 409, 366 ], "y": [ -303, -270 ] }, { "hoverinfo": "skip", "marker": { "color": "LightGreen", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "bgen_2_1", "showlegend": false, "type": "scatter", "x": [ 409 ], "y": [ -303 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "b_bus_gen_2_1", "showlegend": false, "type": "scatter", "x": [ 377.8996398913542 ], "y": [ -279.1322817770858 ] }, { "mode": "text", "name": "gen_5_2", "showlegend": false, "text": [ "gen_5_2
26.8 MW" ], "textposition": "bottom left", "type": "scatter", "x": [ -118.18789262689701 ], "y": [ 37.858925600498765 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -111, -64 ], "y": [ 40, 54 ] }, { "hoverinfo": "skip", "marker": { "color": "LightGreen", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "bgen_5_2", "showlegend": false, "type": "scatter", "x": [ -111 ], "y": [ 40 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "b_bus_gen_5_2", "showlegend": false, "type": "scatter", "x": [ -78.37578525379402 ], "y": [ 49.71785120099753 ] }, { "mode": "text", "name": "gen_7_3", "showlegend": false, "text": [ "gen_7_3
0.0 MW" ], "textposition": "top right", "type": "scatter", "x": [ 612.4950462345982 ], "y": [ 2.2725471358035723 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ 605, 550 ], "y": [ 2, 0 ] }, { "hoverinfo": "skip", "marker": { "color": "LightGreen", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "bgen_7_3", "showlegend": false, "type": "scatter", "x": [ 605 ], "y": [ 2 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "b_bus_gen_7_3", "showlegend": false, "type": "scatter", "x": [ 564.9900924691965 ], "y": [ 0.5450942716071447 ] }, { "mode": "text", "name": "gen_0_4", "showlegend": false, "text": [ "gen_0_4
67.74 MW" ], "textposition": "bottom left", "type": "scatter", "x": [ -339.27606875109 ], "y": [ -95.8190171877725 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1 }, "showlegend": false, "type": "scatter", "x": [ -332, -280 ], "y": [ -94, -81 ] }, { "hoverinfo": "skip", "marker": { "color": "LightGreen", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 15 }, "mode": "markers", "name": "bgen_0_4", "showlegend": false, "type": "scatter", "x": [ -332 ], "y": [ -94 ] }, { "hoverinfo": "skip", "marker": { "color": "red", "showscale": false, "size": 12 }, "name": "b_bus_gen_0_4", "showlegend": false, "type": "scatter", "x": [ -294.55213750217996 ], "y": [ -84.63803437554499 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_0", "showlegend": false, "type": "scatter", "x": [ -280 ], "y": [ -81 ] }, { "mode": "text", "name": "sub_0", "showlegend": false, "text": [ "0" ], "textposition": "middle center", "type": "scatter", "x": [ -280 ], "y": [ -81 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_1", "showlegend": false, "type": "scatter", "x": [ -100 ], "y": [ -270 ] }, { "mode": "text", "name": "sub_1", "showlegend": false, "text": [ "1" ], "textposition": "middle center", "type": "scatter", "x": [ -100 ], "y": [ -270 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_2", "showlegend": false, "type": "scatter", "x": [ 366 ], "y": [ -270 ] }, { "mode": "text", "name": "sub_2", "showlegend": false, "text": [ "2" ], "textposition": "middle center", "type": "scatter", "x": [ 366 ], "y": [ -270 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_3", "showlegend": false, "type": "scatter", "x": [ 366 ], "y": [ -54 ] }, { "mode": "text", "name": "sub_3", "showlegend": false, "text": [ "3" ], "textposition": "middle center", "type": "scatter", "x": [ 366 ], "y": [ -54 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_4", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ -54 ] }, { "mode": "text", "name": "sub_4", "showlegend": false, "text": [ "4" ], "textposition": "middle center", "type": "scatter", "x": [ -64 ], "y": [ -54 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_5", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ 54 ] }, { "mode": "text", "name": "sub_5", "showlegend": false, "text": [ "5" ], "textposition": "middle center", "type": "scatter", "x": [ -64 ], "y": [ 54 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_6", "showlegend": false, "type": "scatter", "x": [ 450 ], "y": [ 0 ] }, { "mode": "text", "name": "sub_6", "showlegend": false, "text": [ "6" ], "textposition": "middle center", "type": "scatter", "x": [ 450 ], "y": [ 0 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_7", "showlegend": false, "type": "scatter", "x": [ 550 ], "y": [ 0 ] }, { "mode": "text", "name": "sub_7", "showlegend": false, "text": [ "7" ], "textposition": "middle center", "type": "scatter", "x": [ 550 ], "y": [ 0 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_8", "showlegend": false, "type": "scatter", "x": [ 326 ], "y": [ 54 ] }, { "mode": "text", "name": "sub_8", "showlegend": false, "text": [ "8" ], "textposition": "middle center", "type": "scatter", "x": [ 326 ], "y": [ 54 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_9", "showlegend": false, "type": "scatter", "x": [ 222 ], "y": [ 108 ] }, { "mode": "text", "name": "sub_9", "showlegend": false, "text": [ "9" ], "textposition": "middle center", "type": "scatter", "x": [ 222 ], "y": [ 108 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_10", "showlegend": false, "type": "scatter", "x": [ 79 ], "y": [ 162 ] }, { "mode": "text", "name": "sub_10", "showlegend": false, "text": [ "10" ], "textposition": "middle center", "type": "scatter", "x": [ 79 ], "y": [ 162 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_11", "showlegend": false, "type": "scatter", "x": [ -170 ], "y": [ 270 ] }, { "mode": "text", "name": "sub_11", "showlegend": false, "text": [ "11" ], "textposition": "middle center", "type": "scatter", "x": [ -170 ], "y": [ 270 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_12", "showlegend": false, "type": "scatter", "x": [ -64 ], "y": [ 270 ] }, { "mode": "text", "name": "sub_12", "showlegend": false, "text": [ "12" ], "textposition": "middle center", "type": "scatter", "x": [ -64 ], "y": [ 270 ] }, { "hoverinfo": "skip", "marker": { "color": "PaleTurquoise", "line": { "color": "black", "width": 1 }, "showscale": false, "size": 30 }, "mode": "markers", "name": "zsub_13", "showlegend": false, "type": "scatter", "x": [ 222 ], "y": [ 216 ] }, { "mode": "text", "name": "sub_13", "showlegend": false, "text": [ "13" ], "textposition": "middle center", "type": "scatter", "x": [ 222 ], "y": [ 216 ] } ], "layout": { "height": 600, "margin": { "b": 0, "l": 0, "pad": 0, "r": 0, "t": 0 }, "plot_bgcolor": "rgba(0,0,0,0)", "showlegend": false, "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 } } }, "width": 900, "xaxis": { "visible": false }, "yaxis": { "visible": false } } }, "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from grid2op.PlotGrid import PlotPlotly\n", "obs = copy.deepcopy(this_episode.observations[-1])\n", "# and change the topology (just to have something to represent)\n", "obs.topo_vect[3:9] = [2,2,1,1,2,1]\n", "\n", "plot_helper = PlotPlotly(observation_space=this_episode.observation_space, width=900, height=600)\n", "plot_helper._line_bus_radius = 12\n", "fig = plot_helper.plot_obs(obs)\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this plot, we can see that the \"action\" (that is implemented here only to demonstrate the plotting utility) has the following effect.\n", "\n", "After its application, a power plants, and powerline are connected together on bus 2. This is represented by the magenta dot.\n", "The rest of the topology is still connected to bus 1 (in red) or diconnected (in black)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Synching Observation and Action" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As stated in the documentation, at row i, it's the observation at time \"i\" and the action at time \"i\". So at row i of the numpy matrices, we see what the agent saw when he took his actions. We have \"an agent view\".\n", "\n", "In case we want to see the impact of an Action, it is then necessary to:\n", "\n", "- look at action i\n", "- look at observation i+1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Using the dedicated grid2viz framework\n", "\n", "Grid2viz is a package that has been developped to help you visualize the behaviour of your agent. \n", "\n", "It is available for now in a github repository [grid2viz](https://github.com/mjothy/grid2viz). In the few following cells we will demonstrate how to use it to inspect in more detail the log of the agents generated by the runner (second cell of this notebook).\n", "\n", "\n", "We will first run some other agents to show the full potential of grid2viz (optional). Then we emphasize a constraint on the use of grid2viz: the folder tree must respect a certain order. Then we show how to install it and finally how to launch it on the data generated by this notebook.\n", "\n", "![](https://raw.githubusercontent.com/mjothy/grid2viz/master/grid2viz/assets/screenshots/scenario_overview.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### More agents to compare\n", "\n", "This section is not mandatory, but it is better to show the full capabilities of grid2viz. We will first run 2 others agents: the do nothing agent, and the topology greedy agents." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The results for the DoNothingAgent agent are:\n", "\tFor chronics with id 000\n", "\t\t - cumulative reward: 482.929718\n", "\t\t - number of time steps completed: 30 / 30\n", "\tFor chronics with id 001\n", "\t\t - cumulative reward: 501.151642\n", "\t\t - number of time steps completed: 30 / 30\n" ] } ], "source": [ "# make a runner for this agent\n", "from grid2op.Agent import DoNothingAgent, TopologyGreedy\n", "\n", "for agentClass, agentName in zip([DoNothingAgent], # , TopologyGreedy\n", " [\"DoNothingAgent\"]): # , \"TopologyGreedy\"\n", " path_agent = os.path.join(path_agents, agentName)\n", " shutil.rmtree(os.path.abspath(path_agent), ignore_errors=True)\n", " runner = Runner(**env.get_params_for_runner(),\n", " agentClass=agentClass\n", " )\n", " res = runner.run(path_save=path_agent, nb_episode=2, \n", " max_iter=max_iter)\n", " print(\"The results for the {} agent are:\".format(agentName))\n", " for _, chron_id, cum_reward, nb_time_step, max_ts in res:\n", " msg_tmp = \"\\tFor chronics with id {}\\n\".format(chron_id)\n", " msg_tmp += \"\\t\\t - cumulative reward: {:.6f}\\n\".format(cum_reward)\n", " msg_tmp += \"\\t\\t - number of time steps completed: {:.0f} / {:.0f}\".format(nb_time_step, max_ts)\n", " print(msg_tmp)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Caution" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Grid2Viz for now require a specific organization of the folders. You must:\n", "- use the runner to save the results of your experiment, using the \"path_save\" argument\n", "- the agent must be \"alone\" in this directory: you should save it to an empty directory\n", "- the path where the agent is stored must contain only folder of agents.\n", "\n", "These contraints give the following \"architecture\":\n", "\n", "+ regular directory\n", " + runner log\n", " + agent log 1\n", " - scenario log 1\n", " - scenario log 2\n", " ...\n", " - scenario log n\n", " + agent log 2\n", " - scenario log 1\n", " ...\n", " - scenario log p\n", " + agent log 3\n", " - scenario log 1\n", " ...\n", " + other folders\n", "+ other folders\n", "\n", "An example is given in the \"path_agents\" directory used in this notebook." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "study_agent_getting_started:\r\n", "DoNothingAgent\tPowerLineSwitch\r\n", "\r\n", "study_agent_getting_started/DoNothingAgent:\r\n", "000 dict_action_space.json\t dict_observation_space.json\r\n", "001 dict_env_modification_space.json\r\n", "\r\n", "study_agent_getting_started/DoNothingAgent/000:\r\n", "actions.npz\t\t\t episode_meta.json _parameters.json\r\n", "agent_exec_times.npz\t\t episode_times.json rewards.npz\r\n", "disc_lines_cascading_failure.npz observations.npz\r\n", "env_modifications.npz\t\t other_rewards.json\r\n", "\r\n", "study_agent_getting_started/DoNothingAgent/001:\r\n", "actions.npz\t\t\t episode_meta.json _parameters.json\r\n", "agent_exec_times.npz\t\t episode_times.json rewards.npz\r\n", "disc_lines_cascading_failure.npz observations.npz\r\n", "env_modifications.npz\t\t other_rewards.json\r\n", "\r\n", "study_agent_getting_started/PowerLineSwitch:\r\n", "000 dict_action_space.json\t dict_observation_space.json\r\n", "001 dict_env_modification_space.json\r\n", "\r\n", "study_agent_getting_started/PowerLineSwitch/000:\r\n", "actions.npz\t\t\t episode_meta.json _parameters.json\r\n", "agent_exec_times.npz\t\t episode_times.json rewards.npz\r\n", "disc_lines_cascading_failure.npz observations.npz\r\n", "env_modifications.npz\t\t other_rewards.json\r\n", "\r\n", "study_agent_getting_started/PowerLineSwitch/001:\r\n", "actions.npz\t\t\t episode_meta.json _parameters.json\r\n", "agent_exec_times.npz\t\t episode_times.json rewards.npz\r\n", "disc_lines_cascading_failure.npz observations.npz\r\n", "env_modifications.npz\t\t other_rewards.json\r\n" ] } ], "source": [ "!ls -R $path_agents" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the command \"tree\" is installed on your machine, you can uncomment the following cell to have a better layout." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "# !tree $path_agents" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Installation\n", "\n", "Grid2Viz is not yet on pypi, the python package repository. So you need a specific command to install it. It can be done super easily by running the cell bellow (more information can be found on the grid2iz github)." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "To install it, either uncomment the cell bellow, or type, in a command prompt:\n", "\t/usr/bin/python3 -m pip install git+https://github.com/mjothy/grid2viz.git --user --extra-index-url https://test.pypi.org/simple/\n" ] } ], "source": [ "import sys\n", "print(\"To install it, either uncomment the cell bellow, or type, in a command prompt:\\n{}\".format(\n", " (\"\\t{} -m pip install git+https://github.com/mjothy/grid2viz.git --user --extra-index-url https://test.pypi.org/simple/\".format(sys.executable))))" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "# !$sys.executable -m pip install git+https://github.com/mjothy/grid2viz --user --extra-index-url https://test.pypi.org/simple/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once the above package is installed, you can now start to study what your agent did (NB the agent must have been run with a runner and the \"path_save\" argument in order for grid2viz to work properly." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "You can start this server either by running the next cell, or by typing in a cmd:\n", "\t\t/usr/bin/python3 -m grid2viz.main --path /home/benjamin/Documents/grid2op_dev/getting_started/study_agent_getting_started\n" ] } ], "source": [ "print(\"You can start this server either by running the next cell, or by typing in a cmd:\\n\"\\\n", " \"\\t\\t{} -m grid2viz.main --path {}\".format(sys.executable, os.path.abspath(path_agents)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For performance optimization, grid2viz uses a cache. This notebook being an example, it is recommended to clear the cache before starting the grid2viz app. Of course, if you study different generation of your agent, it is NOT recommended to clear the cache before any study." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "shutil.rmtree(os.path.join(os.path.abspath(path_agents), \"_cache\"), ignore_errors=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!$sys.executable -m grid2viz.main --path=$path_agents" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.2" } }, "nbformat": 4, "nbformat_minor": 2 }