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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Maréchal
ST7-Intel
Commits
290dba92
Commit
290dba92
authored
4 years ago
by
Matthieu Oberon
Browse files
Options
Downloads
Patches
Plain Diff
add results for extraction of paths at last iteration
parent
73053ddf
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
results/images/path_stability.png
+0
-0
0 additions, 0 deletions
results/images/path_stability.png
results/result_exploitation.py
+0
-23
0 additions, 23 deletions
results/result_exploitation.py
results/stability_test.py
+69
-0
69 additions, 0 deletions
results/stability_test.py
with
69 additions
and
23 deletions
results/images/path_stability.png
0 → 100644
+
0
−
0
View file @
290dba92
43.9 KiB
This diff is collapsed.
Click to expand it.
results/result_exploitation.py
+
0
−
23
View file @
290dba92
...
@@ -61,26 +61,3 @@ plt.ylabel("Temps d'exécution (s)")
...
@@ -61,26 +61,3 @@ plt.ylabel("Temps d'exécution (s)")
plt
.
title
(
"
Temps d
'
exécution de la routine d
'
optimisation
\n
pour un problème 256*256*256 avec 10 générations de 64 fourmis.
"
)
plt
.
title
(
"
Temps d
'
exécution de la routine d
'
optimisation
\n
pour un problème 256*256*256 avec 10 générations de 64 fourmis.
"
)
plt
.
legend
()
plt
.
legend
()
plt
.
show
()
plt
.
show
()
###########################################################################
## Test stability of the code
###########################################################################
for
i
in
range
(
1
,
7
):
throughputs
=
[]
iter_list
=
[]
iter
=
1
with
open
(
f
"
16np_32ants_400iter/cost_opti_16np_32ants_400iter_
{
i
}
.txt
"
,
'
r
'
)
as
file
:
for
line
in
file
:
cost
=
float
(
line
.
strip
(
"
\n
"
))
throughputs
.
append
(
cost
)
iter_list
.
append
(
iter
)
iter
+=
1
plt
.
plot
(
iter_list
,
throughputs
,
'
*-
'
,
label
=
f
"
Batch
{
i
}
"
)
plt
.
title
(
"
Résulats de plusiseurs batchs pour 400 générations de 32 fourmis sur 16 process.
"
)
plt
.
xlabel
(
"
Iteration
"
)
plt
.
ylabel
(
"
Throughput optimal (MPoint/s)
"
)
plt
.
legend
()
plt
.
show
()
This diff is collapsed.
Click to expand it.
results/stability_test.py
0 → 100644
+
69
−
0
View file @
290dba92
import
matplotlib.pyplot
as
plt
import
math
###########################################################################
## Test stability of the code
###########################################################################
for
i
in
range
(
1
,
7
):
throughputs
=
[]
iter_list
=
[]
iter
=
1
with
open
(
f
"
16np_32ants_400iter/cost_opti_16np_32ants_400iter_
{
i
}
.txt
"
,
'
r
'
)
as
file
:
for
line
in
file
:
cost
=
float
(
line
.
strip
(
"
\n
"
))
throughputs
.
append
(
cost
)
iter_list
.
append
(
iter
)
iter
+=
1
plt
.
plot
(
iter_list
,
throughputs
,
'
*-
'
,
label
=
f
"
Batch
{
i
}
"
)
plt
.
title
(
"
Résulats de plusiseurs batchs pour 400 générations de 32 fourmis sur 16 process.
"
)
plt
.
xlabel
(
"
Iteration
"
)
plt
.
ylabel
(
"
Throughput optimal (MPoint/s)
"
)
plt
.
legend
()
plt
.
show
()
###########################################################################
## Test stability of path at last iteration
###########################################################################
batches
=
[
1
,
2
,
3
,
4
,
5
,
6
]
fig
,
axs
=
plt
.
subplots
(
2
,
3
)
max_nb_paths
=
0
width
=
0.5
for
batch
in
batches
:
paths
=
[]
count
=
[]
costs
=
[]
with
open
(
f
"
16np_32ants_400iter/result_16np_32ants_400iter_
{
batch
}
.out
"
,
"
r
"
)
as
file
:
for
line
in
file
:
if
line
[
0
:
4
]
==
"
Path
"
:
iteration
=
int
(
line
.
split
(
"
"
)[
4
])
if
iteration
==
399
:
path
=
(
line
.
split
(
"
[
"
)[
1
]).
split
(
"
]
"
)[
0
]
cost
=
-
1
*
float
((
line
.
split
(
"
"
)[
-
1
]).
strip
(
"
.
\n
"
))
if
path
in
paths
:
i
=
paths
.
index
(
path
)
count
[
i
]
+=
1
costs
[
i
]
+=
cost
else
:
paths
.
append
(
path
)
count
.
append
(
1
)
costs
.
append
(
cost
)
for
i
in
range
(
len
(
paths
)):
costs
[
i
]
=
costs
[
i
]
/
count
[
i
]
costs
,
paths
,
count
=
map
(
list
,
zip
(
*
sorted
(
zip
(
costs
,
paths
,
count
),
reverse
=
True
)))
if
len
(
paths
)
>
max_nb_paths
:
max_nb_paths
=
len
(
paths
)
axs
[(
batch
-
1
)
%
2
,
math
.
floor
((
batch
-
1
)
/
2
)].
bar
(
range
(
len
(
paths
)),
count
,
width
=
width
)
axs
[(
batch
-
1
)
%
2
,
math
.
floor
((
batch
-
1
)
/
2
)].
set_title
(
f
"
Batch
{
batch
}
"
)
for
batch
in
batches
:
axs
[(
batch
-
1
)
%
2
,
math
.
floor
((
batch
-
1
)
/
2
)].
set_xlim
(
-
2
*
width
,
max_nb_paths
+
2
*
width
)
axs
[
0
,
0
].
set_ylabel
(
"
Nombre de fourmis par chemin
"
)
axs
[
0
,
0
].
set_xlabel
(
"
Chemins triés par throughput décroissant
"
)
fig
.
suptitle
(
"
Chemins suivis à la dernière itération pour différents batchs.
"
)
fig
.
tight_layout
(
pad
=
0.5
)
plt
.
show
()
plt
.
close
(
10
)
\ No newline at end of file
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