Skip to content

Commit 770fcaf

Browse files
committed
Plot descriptions
1 parent 829533a commit 770fcaf

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

Genetic_Algorithm_Assignment.ipynb

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,35 +955,55 @@
955955
}
956956
]
957957
},
958+
{
959+
"cell_type": "markdown",
960+
"metadata": {
961+
"id": "nGw3JHBKp1_J",
962+
"colab_type": "text"
963+
},
964+
"source": [
965+
"### **Plotting the Final Result**\n",
966+
"\n",
967+
"This plot shows 3 import facts about the final solution. \n",
968+
"\n",
969+
"\n",
970+
"1. The Horizontal Line shows the 4,500MB benchmark line\n",
971+
"2. The Zig Zag plot shows the Fitness of the Final Population\n",
972+
"3. The Red Cross (+) shows the position of the Optimum solution Generated\n",
973+
"\n",
974+
"\n",
975+
"\n"
976+
]
977+
},
958978
{
959979
"cell_type": "code",
960980
"metadata": {
961981
"id": "4DYhr1UnHHC0",
962982
"colab_type": "code",
963-
"outputId": "92020dc7-0ee6-41e1-8eb3-dc4d959413e6",
983+
"outputId": "47f29ba3-ce9d-403a-ef0c-bae7d765e9ad",
964984
"colab": {
965985
"base_uri": "https://localhost:8080/",
966986
"height": 286
967987
}
968988
},
969989
"source": [
970990
"plt.plot([x for x in range(popSize)],[finalSize[x] for x in range(len(finalSize))])\n",
971-
"plt.plot([finalDuration.index(max(finalDuration))],[finalSize[finalDuration.index(max(finalDuration))]],'r+')\n",
991+
"plt.plot([Best_Solution_id],[Best_Solution_Size],'r+')\n",
972992
"plt.plot([x for x in range(popSize)],[4500 for x in range(len(finalSize))])"
973993
],
974-
"execution_count": 21,
994+
"execution_count": 32,
975995
"outputs": [
976996
{
977997
"output_type": "execute_result",
978998
"data": {
979999
"text/plain": [
980-
"[<matplotlib.lines.Line2D at 0x7f3903cc7a20>]"
1000+
"[<matplotlib.lines.Line2D at 0x7f390110c358>]"
9811001
]
9821002
},
9831003
"metadata": {
9841004
"tags": []
9851005
},
986-
"execution_count": 21
1006+
"execution_count": 32
9871007
},
9881008
{
9891009
"output_type": "display_data",

0 commit comments

Comments
 (0)