Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
M
Multi-Objectives_Optimization_IBEA
Gestion
Activité
Membres
Programmation
Wiki externe
Code
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Déploiement
Releases
Registre de conteneurs
Registre de modèles
Analyse
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
SPLiiNe
Multi-Objectives_Optimization_IBEA
Validations
7372792e
Valider
7372792e
rédigé
Il y a 8 ans
par
Jonathan CROUZET
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Debug : Running program
parent
1199168e
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
4
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
4 fichiers modifiés
src/ibea/combination.cpp
+1
-3
1 ajout, 3 suppressions
src/ibea/combination.cpp
src/ibea/ibea.cpp
+1
-10
1 ajout, 10 suppressions
src/ibea/ibea.cpp
src/ibea/population.cpp
+10
-16
10 ajouts, 16 suppressions
src/ibea/population.cpp
src/ibea/tournament.cpp
+0
-15
0 ajout, 15 suppressions
src/ibea/tournament.cpp
avec
12 ajouts
et
44 suppressions
src/ibea/combination.cpp
+
1
−
3
Voir le fichier @
7372792e
#include
<utility>
#include
<cstdlib>
#include
<iostream>
#include
"../coco/coco.h"
#include
"population.h"
#include
"combination.h"
using
namespace
std
;
std
::
pair
<
double
,
double
>
simple_combination
(
double
parent1
,
double
parent2
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/ibea/ibea.cpp
+
1
−
10
Voir le fichier @
7372792e
...
...
@@ -30,7 +30,6 @@ void ibea(evaluate_function_t evaluate,
cout
<<
"Initialize"
<<
endl
;
Population
pop
=
Population
(
n_individus
,
dimension
,
number_of_objectives
);
Population
new_pop
=
Population
(
n_individus
,
dimension
,
number_of_objectives
);
pop
.
random_init
(
lower_bounds
,
upper_bounds
,
random_generator
);
/* Iterations */
...
...
@@ -41,32 +40,24 @@ void ibea(evaluate_function_t evaluate,
pop
.
evaluate
(
evaluate
);
pop
.
compute_indicators
();
pop
.
compute_fitnesses
(
kappa
);
pop
.
printFitnesses
();
cout
<<
"Evaluation & Fitness done"
<<
endl
;
new_pop
.
empty
();
cout
<<
"New population !"
<<
endl
;
while
(
new_pop
.
getCurrentSize
()
<
n_individus
){
/* 3 Environemental select */
cout
<<
"Darwin begin"
<<
endl
;
pop
.
darwin
(
kappa
);
cout
<<
"Darwin done"
<<
endl
;
pop
.
printFitnesses
();
/* 4 */
/* 5 Fill mating pool */
cout
<<
"Tournament begin"
<<
endl
;
binary_tournament
(
pop
,
new_pop
,
mu
,
random_generator
);
cout
<<
"Tournament done"
<<
endl
;
pop
.
printFitnesses
();
}
cout
<<
"Shit done"
<<
endl
;
/* 6 Combination and Mutation */
pop
.
empty
();
cout
<<
"Shit2 done"
<<
endl
;
combinate
(
new_pop
,
pop
,
eta
,
p_combination
,
random_generator
);
cout
<<
"Combination done"
<<
endl
;
mutate
(
pop
,
lower_bounds
,
upper_bounds
,
eta
,
p_mutation
,
random_generator
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/ibea/population.cpp
+
10
−
16
Voir le fichier @
7372792e
#include
<cstdlib>
#include
<cmath>
#include
<iostream>
#include
<cstdio>
#include
"../coco/coco.h"
#include
"indicator.h"
#include
"population.h"
using
namespace
std
;
Population
::
Population
(
int
size
,
int
dimension
,
int
n_objectives
)
:
size_
(
size
),
current_size_
(
0
),
dimension_
(
dimension
),
n_objectives_
(
n_objectives
)
{
...
...
@@ -27,7 +24,7 @@ Population::Population(int size, int dimension, int n_objectives) :
indicator_values_
[
i
]
=
(
double
*
)
coco_allocate_memory
(
size_
*
sizeof
(
double
));
}
fitnesses_
=
(
double
*
)
coco_allocate_memory
(
dimension
_
*
sizeof
(
double
));
fitnesses_
=
(
double
*
)
coco_allocate_memory
(
size
_
*
sizeof
(
double
));
}
Population
::~
Population
(){
...
...
@@ -74,13 +71,10 @@ void Population::empty(){
}
void
Population
::
setIndiv
(
int
i
,
int
j
,
double
value
){
cout
<<
"setIndiv("
<<
i
<<
", "
<<
j
<<
") : "
<<
size_
<<
", "
<<
dimension_
<<
endl
;
population_
[
i
][
j
]
=
value
;
cout
<<
"setIndiv end"
<<
endl
;
}
double
Population
::
getIndiv
(
int
i
,
int
j
){
cout
<<
"getIndiv("
<<
i
<<
", "
<<
j
<<
") : "
<<
size_
<<
", "
<<
dimension_
<<
endl
;
return
population_
[
i
][
j
];
}
...
...
@@ -220,8 +214,8 @@ void Population::darwin(double kappa){
}
void
Population
::
printPopulation
(){
cout
<<
"Population :
"
<<
endl
;
for
(
int
i
=
0
;
i
<
current_
size_
;
i
++
){
printf
(
"Population :
\n
"
)
;
for
(
int
i
=
0
;
i
<
size_
;
i
++
){
for
(
int
j
=
0
;
j
<
dimension_
;
j
++
){
printf
(
"%+6.4lf "
,
population_
[
i
][
j
]);
}
...
...
@@ -230,8 +224,8 @@ void Population::printPopulation(){
}
void
Population
::
printValues
(){
cout
<<
"Values :
"
<<
endl
;
for
(
int
i
=
0
;
i
<
current_
size_
;
i
++
){
printf
(
"Values :
\n
"
)
;
for
(
int
i
=
0
;
i
<
size_
;
i
++
){
for
(
int
j
=
0
;
j
<
dimension_
;
j
++
){
printf
(
"%+6.4lf "
,
values_
[
i
][
j
]);
}
...
...
@@ -240,9 +234,9 @@ void Population::printValues(){
}
void
Population
::
printIndicatorValues
(){
cout
<<
"Indicator Values :
"
<<
endl
;
for
(
int
i
=
0
;
i
<
current_
size_
;
i
++
){
for
(
int
j
=
0
;
j
<
current_
size_
;
j
++
){
printf
(
"Indicator Values :
\n
"
)
;
for
(
int
i
=
0
;
i
<
size_
;
i
++
){
for
(
int
j
=
0
;
j
<
size_
;
j
++
){
printf
(
"%+6.4lf "
,
indicator_values_
[
i
][
j
]);
}
printf
(
"
\n
"
);
...
...
@@ -250,8 +244,8 @@ void Population::printIndicatorValues(){
}
void
Population
::
printFitnesses
(){
cout
<<
"Fitnesses :
"
<<
endl
;
for
(
int
i
=
0
;
i
<
current_
size_
;
i
++
){
printf
(
"Fitnesses :
\n
"
)
;
for
(
int
i
=
0
;
i
<
size_
;
i
++
){
printf
(
"%+6.4lf "
,
fitnesses_
[
i
]);
}
printf
(
"
\n
"
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/ibea/tournament.cpp
+
0
−
15
Voir le fichier @
7372792e
#include
<iostream>
#include
"../coco/coco.h"
#include
"population.h"
#include
"tournament.h"
using
namespace
std
;
void
binary_tournament
(
Population
&
population_in
,
Population
&
population_out
,
int
mu
,
...
...
@@ -23,26 +19,15 @@ void binary_tournament(Population & population_in,
if
(
population_in
.
getFit
(
i
)
>
population_in
.
getFit
(
j
))
{
for
(
int
m
=
0
;
m
<
population_out
.
getDim
();
m
++
){
cout
<<
"test2"
<<
endl
;
population_out
.
setIndiv
(
size_out
+
k
,
m
,
population_in
.
getIndiv
(
i
,
m
));
cout
<<
"test3"
<<
endl
;
}
}
else
{
for
(
int
m
=
0
;
m
<
population_out
.
getDim
();
m
++
){
population_in
.
printPopulation
();
population_in
.
printFitnesses
();
cout
<<
"test"
<<
endl
;
population_out
.
setIndiv
(
size_out
+
k
,
m
,
population_in
.
getIndiv
(
j
,
m
));
cout
<<
"test1"
<<
endl
;
}
cout
<<
"test5"
<<
endl
;
}
cout
<<
"test6"
<<
endl
;
k
++
;
cout
<<
"test7"
<<
endl
;
}
cout
<<
"test8"
<<
endl
;
population_out
.
setCurrenSize
(
size_out
+
k
);
cout
<<
"test9"
<<
endl
;
}
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter