Information Technology Reference
In-Depth Information
Trial Flatten Table If Cr Random ,
Population i, 2, j , 1 i, j ,
i, NP , j, Dim & Noisy ,1
442.422, 560.034 , 194.845, 354.393 , 127.976, 99.3825 ,
718.466, 244.138 , 236.027, 128.204 , 335.943, 355.91 ,
317.752, 402.607 , 119.503, 163.852 , 507.525, 502.251 , 160.401, 149.99
Fig. 7.19. Trial Vector
BoundaryChecking Flatten MapIndexed
CheckInterval 1, 2 &, 1
,1 & Trial
442.422, 2.47524 , 194.845, 354.393 , 127.976, 99.3825 ,
300.954, 244.138 , 236.027, 128.204 , 335.943, 355.91 ,
317.752, 402.607 , 119.503, 163.852 , 507.525, 502.251 , 160.401, 149.99
Fig. 7.20. Boundary Checking
In[44]:= IndividualsCostValue CostFunction 1 , 1 & BoundaryChecking
364.224, 442.422, 2.47524 , 200.331, 194.845, 354.393 ,
70.135, 127.976, 99.3825 , 279.978, 300.954, 244.138 ,
41.6243, 236.027, 128.204 , 161.461, 335.943, 355.91 ,
106.047, 317.752, 402.607 , 157.266, 119.503, 163.852 ,
464.407, 507.525, 502.251 , 62.8734, 160.401, 149.99
Out[44]=
Fig. 7.21. Individual Cost Value
NewPopulation MapThread If 1 1 2 1 , 1, 2 &,
Population, IndividualsCostValue
364.224, 442.422, 2.47524 , 200.331, 194.845, 354.393 ,
70.135, 127.976, 99.3825 , 208.07, 214.324, 244.138 ,
41.6243, 236.027, 128.204 , 161.461, 335.943, 355.91 ,
106.047, 317.752, 402.607 , 157.266, 119.503, 163.852 ,
464.407, 507.525, 502.251 , 62.8734, 160.401, 149.99
Fig. 7.22. Next Population Selection
avoid setting of local or global variables for the trial vector list, the Table command
is used instead of Fo r . Trial vectors are returned in the list given in Fig 7.19, which is
created automatically.
All the Trial vectors are created at once. Before the fitness is calculated, the popula-
tion of the trial individuals are checked for boundary conditions. If some parameter is
out of the allowed boundary, then it is randomly returned back. The function is given in
Fig 7.20.
Now, there exists a repaired set of trial vectors, which is evaluated by the cost func-
tion. It is done by the function CostFunction applied by / @onthe BoundaryChecking
set. Note that the body of each individual in Fig 7.21 is enlarged by the function Indi-
vidualsCostValue .
The better individual of both parent and child is selected into the new population by
means of the MapThread function.
Search WWH ::




Custom Search