Bonjour,
je veux implémenter l'algorithme génetique suivant en matlab mais je trouve des difficultés j'arrive maintenant au step 2 et je peux pas le passer je sais pas comment je vais évaluer la population initiale .
voici l'algorithme:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Set iteration counter i=0.
Set initial parameters: Termination condition: T_c; Population Size: Z; tournament probability:T_p
Step 1:
Generate the initial population P_i With the size Z.
Step 2: Evaluate P_i
If Pass the
Step 3:
Do while not
Select Elite = the best individual According to fitness value
For j =2 to z
Selects two parents (Pr1, Pr2) using selection operator with
 
probability T_p
‘Generate the offspring using crossover on the selected individuals using following formula:
Offspring=crossover(Pr1, Pr2)
‘Checks the validity of the offspring if not passes, then apply repair procedure.
If not checkIndividual (offspring) then
RepairGenes(offspring)
End if
‘Add offspring to the crossover population .
P_c Add (offspring)
Next j
‘Apply mutation using the following formula: 
P_m=mutate(P_c)
Create a new generation From the Elite the individuals in P_m
I=i+1
Loop
la fonction objective est de minimiser ∂= min ⁡1/n (∑ x_i^2 )avec x_i est la distance entre le mesh router et le gateway le plus proche.
svp pouvez vous m'aider
merci d'avance
cordialement