Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Code_Sidang_Ulang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ari Whuandaniel Manurung
Code_Sidang_Ulang
Commits
5bffc7ae
Commit
5bffc7ae
authored
Jul 23, 2020
by
Ari Whuandaniel Manurung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commitv3
parent
d11f1263
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
28 deletions
+43
-28
Swarm ACO-checkpoint.ipynb
.ipynb_checkpoints/Swarm ACO-checkpoint.ipynb
+0
-0
Swarm ACO.ipynb
Swarm ACO.ipynb
+43
-28
No files found.
.ipynb_checkpoints/Swarm ACO-checkpoint.ipynb
0 → 100644
View file @
5bffc7ae
This diff is collapsed.
Click to expand it.
Swarm ACO.ipynb
View file @
5bffc7ae
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
18
,
"execution_count":
30
,
"metadata": {
"metadata": {
"scrolled": true
"scrolled": true
},
},
...
@@ -307,24 +307,39 @@
...
@@ -307,24 +307,39 @@
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"Route : [
2, 14, 35, 20, 31, 23, 5, 2
]\n",
"Route : [
4, 23, 31, 14, 32, 4
]\n",
"
17.68
, 399333 , 26.897694\n",
"
27.43
, 399333 , 26.897694\n",
"\n",
"\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": [
"source": [
"running =
1
\n",
"running =
5
\n",
"global_distance = []\n",
"global_distance = []\n",
"\n",
"\n",
"for run in range (running):\n",
"for run in range (running):\n",
" iterasi =
30
0\n",
" iterasi =
5
0\n",
" alpha = 2 #jejak pheromon\n",
" alpha = 2 #jejak pheromon\n",
" beta = 2#visibility\n",
" beta = 2#visibility\n",
" individu = 40\n",
" individu = 40\n",
" n_kota =
7
\n",
" n_kota =
5
\n",
" evaporation_coeff = 0.1\n",
" evaporation_coeff = 0.1\n",
" Q = 1\n",
" Q = 1\n",
" nodelist = []\n",
" nodelist = []\n",
...
@@ -352,12 +367,12 @@
...
@@ -352,12 +367,12 @@
" tau = update_tau(individu, tau, tabulists, L, evaporation_coeff, Q,n_kota)\n",
" tau = update_tau(individu, tau, tabulists, L, evaporation_coeff, Q,n_kota)\n",
"\n",
"\n",
" print (\"Route : \",route)\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",
" global_distance.append(shortest_distance)\n",
" print(\"\\n\")\n",
" print(\"\\n\")\n",
"\n",
"\n",
"for shortest in global_distance:\n",
"
#
for shortest in global_distance:\n",
" print (shortest) \n",
"
#
print (shortest) \n",
"\n",
"\n",
"\n",
"\n",
"#print (\"Rata-rata rute terpendek yang dihasilkan: \",np.average(global_distance))\n"
"#print (\"Rata-rata rute terpendek yang dihasilkan: \",np.average(global_distance))\n"
...
@@ -365,16 +380,16 @@
...
@@ -365,16 +380,16 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
19
,
"execution_count":
32
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
"data": {
"data": {
"text/plain": [
"text/plain": [
"[2, 1
4, 35, 20, 31, 23, 5
, 2]"
"[2, 1
6, 24, 18, 7
, 2]"
]
]
},
},
"execution_count":
19
,
"execution_count":
32
,
"metadata": {},
"metadata": {},
"output_type": "execute_result"
"output_type": "execute_result"
}
}
...
@@ -385,7 +400,16 @@
...
@@ -385,7 +400,16 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#route = []"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
...
@@ -400,7 +424,7 @@
...
@@ -400,7 +424,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
21
,
"execution_count":
37
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -408,12 +432,10 @@
...
@@ -408,12 +432,10 @@
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"Pakkodian\n",
"Pakkodian\n",
"Museum T. B. Silalahi Center\n",
"Pantai Meat\n",
"Makam Raja Sisingamangaraja XII\n",
"Dolok Tolong\n",
"Lumban Silintong\n",
"Air Terjun Siboruon\n",
"Monumen Raja Sonakmalela\n",
"Air Terjun Pandumaan\n",
"Balerong Onan Balige\n",
"Bukit Pahoda\n",
"Pakkodian\n"
"Pakkodian\n"
]
]
}
}
...
@@ -428,13 +450,6 @@
...
@@ -428,13 +450,6 @@
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": []
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
}
],
],
"metadata": {
"metadata": {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment