Commitv3

parent d11f1263
......@@ -298,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 30,
"metadata": {
"scrolled": true
},
......@@ -307,24 +307,39 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Route : [2, 14, 35, 20, 31, 23, 5, 2]\n",
"17.68 , 399333 , 26.897694\n",
"Route : [4, 23, 31, 14, 32, 4]\n",
"27.43 , 399333 , 26.897694\n",
"\n",
"\n",
"17.68\n"
"Route : [4, 31, 23, 32, 15, 4]\n",
"45.42999999999999 , 399333 , 26.897694\n",
"\n",
"\n",
"Route : [2, 35, 14, 20, 16, 2]\n",
"25.150000000000002 , 399333 , 26.897694\n",
"\n",
"\n",
"Route : [2, 35, 23, 31, 15, 2]\n",
"22.730000000000004 , 399333 , 26.897694\n",
"\n",
"\n",
"Route : [2, 16, 24, 18, 7, 2]\n",
"59.3 , 399333 , 26.897694\n",
"\n",
"\n"
]
}
],
"source": [
"running = 1\n",
"running = 5\n",
"global_distance = []\n",
"\n",
"for run in range (running):\n",
" iterasi = 300\n",
" iterasi = 50\n",
" alpha = 2 #jejak pheromon\n",
" beta = 2#visibility\n",
" individu = 40\n",
" n_kota = 7\n",
" n_kota = 5\n",
" evaporation_coeff = 0.1\n",
" Q = 1\n",
" nodelist = []\n",
......@@ -352,12 +367,12 @@
" tau = update_tau(individu, tau, tabulists, L, evaporation_coeff, Q,n_kota)\n",
"\n",
" print (\"Route : \",route)\n",
" print (shortest_distance,\",\",min_cost,\",\",Weather)\n",
" print (min_dist,\",\",min_cost,\",\",Weather)\n",
" global_distance.append(shortest_distance)\n",
" print(\"\\n\")\n",
"\n",
"for shortest in global_distance:\n",
" print (shortest) \n",
"#for shortest in global_distance:\n",
"# print (shortest) \n",
"\n",
"\n",
"#print (\"Rata-rata rute terpendek yang dihasilkan: \",np.average(global_distance))\n"
......@@ -365,16 +380,16 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[2, 14, 35, 20, 31, 23, 5, 2]"
"[2, 16, 24, 18, 7, 2]"
]
},
"execution_count": 19,
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
......@@ -385,7 +400,16 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#route = []"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
......@@ -400,7 +424,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 37,
"metadata": {},
"outputs": [
{
......@@ -408,12 +432,10 @@
"output_type": "stream",
"text": [
"Pakkodian\n",
"Museum T. B. Silalahi Center\n",
"Makam Raja Sisingamangaraja XII\n",
"Lumban Silintong\n",
"Monumen Raja Sonakmalela\n",
"Balerong Onan Balige\n",
"Bukit Pahoda\n",
"Pantai Meat\n",
"Dolok Tolong\n",
"Air Terjun Siboruon\n",
"Air Terjun Pandumaan\n",
"Pakkodian\n"
]
}
......@@ -428,13 +450,6 @@
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment