Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ST7-Intel
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Maréchal
ST7-Intel
Commits
9af11d80
Commit
9af11d80
authored
4 years ago
by
Carlos Santos Garcia
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes for crazy ants
parent
335b690d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Appli-iso3dfd/ACO.py
+5
-5
5 additions, 5 deletions
Appli-iso3dfd/ACO.py
with
5 additions
and
5 deletions
Appli-iso3dfd/ACO.py
+
5
−
5
View file @
9af11d80
...
...
@@ -57,7 +57,7 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1_max=256, n2_max
paths
=
[]
costs
=
[]
for
k
in
range
(
nb_ants
//
NbP
):
path
=
compute_path
.
compute_path
(
tau
,
alpha
,
n1_size
,
n2_size
,
n3_size
)
path
=
compute_path
.
compute_path
(
tau
,
alpha
,
n1_size
,
n2_size
,
n3_size
,
fancy_strategy
=
fancy_strategy
)
n1
=
256
*
(
2
**
(
path
[
0
]
-
1
))
n2
=
256
*
(
2
**
(
path
[
1
]
-
1
))
n3
=
256
*
(
2
**
(
path
[
2
]
-
1
))
...
...
@@ -72,7 +72,7 @@ def ACO(Me, NbP, comm, alpha, rho, Q, nb_ants, tau_0, n_iter, n1_max=256, n2_max
paths
=
np
.
array
(
paths
,
dtype
=
"
int32
"
)
costs
=
np
.
array
(
costs
,
dtype
=
"
float64
"
)
if
fancy_strategy
==
'
AS
'
or
fancy_strategy
==
'
ElitistAS
'
:
if
fancy_strategy
==
'
AS
'
or
fancy_strategy
==
'
ElitistAS
'
or
fancy_strategy
==
'
crazy
'
:
#we initialize the best path with the ants already in this process
best_cost
=
np
.
amin
(
costs
)
best_p
=
paths
[
np
.
argmin
(
costs
),
:]
...
...
@@ -149,10 +149,10 @@ if __name__ == "__main__":
alpha
=
1
rho
=
0.1
Q
=
0.1
nb_ants
=
2
nb_ants
=
3
2
tau_0
=
Q
*
300
n_iter
=
1
fancy_strategy
=
"
AS
"
n_iter
=
200
fancy_strategy
=
"
crazy
"
# Parameters for compilation and execution of iso3dfd
nb_threads
=
8
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment