{
"cells": [
{
"cell_type": "markdown",
"id": "3ce77085-3338-46b2-8784-de1187f43f25",
"metadata": {},
"source": [
"## Crossing-Preventing Esau-Williams (CPEW) example"
]
},
{
"cell_type": "markdown",
"id": "71a324a5-727c-40a0-b4df-72d522633b16",
"metadata": {},
"source": [
"CPEW is a heuristic from *interarray* (*optiwindnet*'s predecessor). It takes in the raw location **L** and outputs the routeset **G**."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "672c7061-abbf-4da0-9236-232dde141ac9",
"metadata": {},
"outputs": [],
"source": [
"from optiwindnet.importer import load_repository\n",
"from optiwindnet.svg import svgplot\n",
"from optiwindnet.heuristics import CPEW\n",
"from optiwindnet.interarraylib import calcload"
]
},
{
"cell_type": "markdown",
"id": "92bfd6df-c545-48d2-b4d0-e69a1a6c473b",
"metadata": {},
"source": [
"### Load Merkur"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "51e1e821-a0ea-47c3-a197-4b625bbf3a3b",
"metadata": {},
"outputs": [],
"source": [
"locations = load_repository()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "36ac83fb-02db-4640-b7a5-891715f70b83",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"L = locations.merkur\n",
"svgplot(L)"
]
},
{
"cell_type": "markdown",
"id": "c7d1dd72-c13b-4454-8754-9098e2faf9a8",
"metadata": {},
"source": [
"### Optimize Merkur"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "37c0ec1f-bcc2-4025-92bc-613fdebbf1b1",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
""
],
"text/plain": [
""
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"G = CPEW(L, capacity=9)\n",
"calcload(G)\n",
"svgplot(G)"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}