{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# マシニングセンタスケジューリング\n", "\n", "マシニングセンタは材料(ワーク)の加工を行う機械で、自動工具交換装置(Automatic Tool Changer)を搭載しており、ワーク加工中の工具の入れ替えを自動で行うことができます。\n", "\n", "1 つのマシニングセンタに 1 人の作業員が配置され、ワークの着脱、工具の入れ替えを行うことを考えます。\n", "\n", "一つのワークの完成のフローは下記です。\n", "\n", "1. 工具の装着\n", "2. ワークの装着\n", "3. マシニングセンタによる加工\n", "4. ワークの取り外し\n", "5. 工具の取り外し\n", "\n", "ここで、複数のワークを順番に加工する場合、ワーク加工で使用する工具で共通する工具が多いと、工具の着脱工程を短縮することができます。\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 問題設定\n", "\n", "複数のワークを、加工時間が異なる複数のマシニングセンタとそれぞれの作業者に割り当てる、スケジューリング問題を考えます。\n", "目的関数はメイクスパンとします。\n", "\n", "ここではワークの数を 15、マシニングセンタの数と作業者の人数を 3 とします。\n", "ワークは(w1,w2,...,w15)とマシニングセンタは(m1,m2,m3)と表します。\n", "\n", "### ワーク\n", "\n", "各ワークには、マシニングセンタごとの加工時間が割り当てられています。ここで加工時間は、ワークの装着からワークの取り外しまでの時間とします。\n", "\n", "| ワーク | 加工時間(m1) | 加工時間(m2) | 加工時間(m3) |\n", "| :----: | :----------: | :----------: | :----------: |\n", "| w1 | 10 | 20 | 30 |\n", "| w2 | 20 | 30 | 10 |\n", "| w3 | 30 | 40 | 20 |\n", "| w4 | 40 | 10 | 30 |\n", "| w5 | 10 | 30 | 40 |\n", "| w6 | 20 | 40 | 10 |\n", "| w7 | 30 | 10 | 20 |\n", "| w8 | 40 | 20 | 30 |\n", "| w9 | 10 | 20 | 40 |\n", "| w10 | 20 | 30 | 10 |\n", "| w11 | 30 | 40 | 20 |\n", "| w12 | 40 | 10 | 30 |\n", "| w13 | 10 | 30 | 40 |\n", "| w14 | 20 | 40 | 10 |\n", "| w15 | 30 | 10 | 20 |\n", "\n", "### 使用工具\n", "\n", "各ワークには使用工具が割り当てられており、使用工具の数は 20 で(k1,k2,...,k20)とします。\n", "\n", "| ワーク | 使用工具 |\n", "| :----: | :---------------------: |\n", "| w1 | k1, k2, k3, k4, k5 |\n", "| w2 | k6, k7, k8, k9, k10 |\n", "| w3 | k11, k12, k13, k14, k15 |\n", "| w4 | k16, k17, k18, k19, k20 |\n", "| w5 | k1, k2, k11, k16 |\n", "| w6 | k3, k4, k12, k17 |\n", "| w7 | k5, k6, k13, k18 |\n", "| w8 | k7, k8, k14, k19 |\n", "| w9 | k9, k10, k15, k20 |\n", "| w10 | k1, k6, k11, k16 |\n", "| w11 | k1, k2, k3, k4, k5 |\n", "| w12 | k6, k7, k8, k9, k10 |\n", "| w13 | k11, k12, k13, k14, k15 |\n", "| w14 | k16, k17, k18, k19, k20 |\n", "| w15 | k1, k2, k3, k4, k5 |\n", "\n", "ここで、同一マシニングセンタにおいて、ワークの切り替えにかかる時間を下記のように定めます。\n", "\n", "$$\n", "\\begin{align}\n", "\\text{ワークの切り替え時間} = \\text{工具の取り外し数} \\times \\text{取り外しコスト} + \\text{工具の取付数} \\times \\text{取りつけコスト}\n", "\\end{align}\n", "$$\n", "\n", "今回は$\\text{取り外しコスト} = \\text{取りつけコスト} = 10$とします。\n", "\n", "例えば、ワーク w1 からワーク w2 に切り替えるための時間は、工具 k1, k2, k3, k4, k5 を取り外し、工具 k6, k7, k8, k9, k10 を取り付けるため、$5 \\times 10 + 5 \\times 10 = 100$となります。 \n", "一方、ワーク w1 からワーク w5 に切り替えるための時間は、工具 k3, k4, k5 を取り外し、工具 k11, k16 を取り付けるため、$3 \\times 10 + 2 \\times 10 = 50$となります。\n", "\n", "また使用工具の同時使用可能数は下記とします。\n", "\n", "| 使用工具 | 同時使用可能数 |\n", "| :------: | :------------: |\n", "| k1 | 2 |\n", "| k2 | 2 |\n", "| k3 | 3 |\n", "| k4 | 3 |\n", "| k5 | 3 |\n", "| k6 | 2 |\n", "| k7 | 2 |\n", "| k8 | 2 |\n", "| k9 | 2 |\n", "| k10 | 2 |\n", "| k11 | 2 |\n", "| k12 | 2 |\n", "| k13 | 2 |\n", "| k14 | 2 |\n", "| k15 | 2 |\n", "| k16 | 2 |\n", "| k17 | 3 |\n", "| k18 | 2 |\n", "| k19 | 2 |\n", "| k20 | 2 |\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Amplify Sched を用いた解法\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from amplify_sched import *\n", "import itertools\n", "import pandas as pd\n", "\n", "machine_list = [\"m1\", \"m2\", \"m3\"]\n", "remove_work_time = 10\n", "set_work_time = 10\n", "df_w = pd.DataFrame()\n", "df_w[\"ワーク\"] = [\"w{}\".format(i) for i in range(1, 16)]\n", "df_w[\"m1\"] = [10, 20, 30, 40, 10, 20, 30, 40, 10, 20, 30, 40, 10, 20, 30]\n", "df_w[\"m2\"] = [20, 30, 40, 10, 30, 40, 10, 20, 20, 30, 40, 10, 30, 40, 10]\n", "df_w[\"m3\"] = [30, 10, 20, 30, 40, 10, 20, 30, 40, 10, 20, 30, 40, 10, 20]\n", "df_w[\"使用工具\"] = [\n", " [\"k1\", \"k2\", \"k3\", \"k4\", \"k5\"],\n", " [\"k6\", \"k7\", \"k8\", \"k9\", \"k10\"],\n", " [\"k11\", \"k12\", \"k13\", \"k14\", \"k15\"],\n", " [\"k16\", \"k17\", \"k18\", \"k19\", \"k20\"],\n", " [\"k1\", \"k2\", \"k11\", \"k16\"],\n", " [\"k3\", \"k4\", \"k12\", \"k17\"],\n", " [\"k5\", \"k6\", \"k13\", \"k18\"],\n", " [\"k7\", \"k8\", \"k14\", \"k19\"],\n", " [\"k9\", \"k10\", \"k15\", \"k20\"],\n", " [\"k1\", \"k6\", \"k11\", \"k16\"],\n", " [\"k1\", \"k2\", \"k3\", \"k4\", \"k5\"],\n", " [\"k6\", \"k7\", \"k8\", \"k9\", \"k10\"],\n", " [\"k11\", \"k12\", \"k13\", \"k14\", \"k15\"],\n", " [\"k16\", \"k17\", \"k18\", \"k19\", \"k20\"],\n", " [\"k1\", \"k2\", \"k3\", \"k4\", \"k5\"],\n", "]\n", "df_w.set_index(\"ワーク\", inplace=True)\n", "\n", "df_k = pd.DataFrame()\n", "df_k[\"工具\"] = [\"k{}\".format(i) for i in range(1, 21)]\n", "df_k[\"同時使用可能数\"] = [2, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2]\n", "df_k.set_index(\"工具\", inplace=True)\n", "\n", "\n", "model = Model()\n", "for j in df_w.index:\n", " model.jobs.add(j)\n", " model.jobs[j].append(Task())\n", "for m in machine_list:\n", " model.machines.add(m)\n", "for k in df_k.index:\n", " model.resources.add(k)\n", " model.resources[k].capacity = int(df_k.loc[k, \"同時使用可能数\"])\n", "\n", "\n", "for j in df_w.index:\n", " for m in machine_list:\n", " model.jobs[j][0].processing_times[m] = int(df_w.loc[j, m])\n", " for k in df_w.loc[j, \"使用工具\"]:\n", " model.jobs[j][0].required_resources.append(k)\n", "\n", "setup_times = {}\n", "for j1, j2 in itertools.combinations(df_w.index, 2):\n", " remove_num = len(set(df_w.loc[j1, \"使用工具\"]) - set(df_w.loc[j2, \"使用工具\"]))\n", " add_num = len(set(df_w.loc[j2, \"使用工具\"]) - set(df_w.loc[j1, \"使用工具\"]))\n", " setup_times[(j1, j2)] = remove_num * remove_work_time + add_num * set_work_time\n", " setup_times[(j2, j1)] = add_num * remove_work_time + remove_num * set_work_time\n", "\n", " for m in machine_list:\n", " model.machines[m].setup_times.append((setup_times[(j1, j2)], j1, j2))\n", " model.machines[m].setup_times.append((setup_times[(j2, j1)], j2, j1))" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "base": [ 70 ], "customdata": [ [ "w1", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w1", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "w1", "offsetgroup": "w1", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 10 ], "xaxis": "x", "y": [ "m1" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 0 ], "customdata": [ [ "w2", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w2", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "w2", "offsetgroup": "w2", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 10 ], "xaxis": "x", "y": [ "m3" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 110 ], "customdata": [ [ "w3", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w3", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "w3", "offsetgroup": "w3", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 40 ], "xaxis": "x", "y": [ "m2" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 210 ], "customdata": [ [ "w4", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w4", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "w4", "offsetgroup": "w4", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 30 ], "xaxis": "x", "y": [ "m3" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 190 ], "customdata": [ [ "w5", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w5", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "w5", "offsetgroup": "w5", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 10 ], "xaxis": "x", "y": [ "m1" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 0 ], "customdata": [ [ "w6", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w6", "marker": { "color": "#19d3f3", "pattern": { "shape": "" } }, "name": "w6", "offsetgroup": "w6", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 20 ], "xaxis": "x", "y": [ "m1" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 0 ], "customdata": [ [ "w7", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w7", "marker": { "color": "#FF6692", "pattern": { "shape": "" } }, "name": "w7", "offsetgroup": "w7", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 10 ], "xaxis": "x", "y": [ "m2" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 220 ], "customdata": [ [ "w8", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w8", "marker": { "color": "#B6E880", "pattern": { "shape": "" } }, "name": "w8", "offsetgroup": "w8", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 20 ], "xaxis": "x", "y": [ "m2" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 90 ], "customdata": [ [ "w9", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w9", "marker": { "color": "#FF97FF", "pattern": { "shape": "" } }, "name": "w9", "offsetgroup": "w9", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 40 ], "xaxis": "x", "y": [ "m3" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 220 ], "customdata": [ [ "w10", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w10", "marker": { "color": "#FECB52", "pattern": { "shape": "" } }, "name": "w10", "offsetgroup": "w10", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 20 ], "xaxis": "x", "y": [ "m1" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 110 ], "customdata": [ [ "w11", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w11", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "w11", "offsetgroup": "w11", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 30 ], "xaxis": "x", "y": [ "m1" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 10 ], "customdata": [ [ "w12", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w12", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "w12", "offsetgroup": "w12", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 30 ], "xaxis": "x", "y": [ "m3" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 80 ], "customdata": [ [ "w13", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w13", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "w13", "offsetgroup": "w13", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 30 ], "xaxis": "x", "y": [ "m2" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 200 ], "customdata": [ [ "w14", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w14", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "w14", "offsetgroup": "w14", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 10 ], "xaxis": "x", "y": [ "m3" ], "yaxis": "y" }, { "alignmentgroup": "True", "base": [ 80 ], "customdata": [ [ "w15", 0 ] ], "hovertemplate": "Job=%{customdata[0]}
Start=%{base}
Finish=%{x}
Machine=%{y}
Process=%{customdata[1]}", "legendgroup": "w15", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "w15", "offsetgroup": "w15", "orientation": "h", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ 30 ], "xaxis": "x", "y": [ "m1" ], "yaxis": "y" } ], "layout": { "barmode": "overlay", "legend": { "title": { "text": "Job" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "type": "linear" }, "yaxis": { "anchor": "x", "categoryarray": [ "m3", "m2", "m1" ], "categoryorder": "array", "domain": [ 0, 1 ], "title": { "text": "Machine" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "token = \"xxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n", "gantt = model.solve(token=token, timeout=10)\n", "gantt.timeline(machine_view=True)" ] } ], "metadata": { "kernelspec": { "display_name": "scheduling-engine-sdk-IShfnD0Q", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }