File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
lib/OptimizationEvolutionary/test Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 9494 println (" Solution for Sphere and Rastrigin: " , result)
9595 @test result. u[1 ][1 ] ≈ 7.88866e-5 atol= 1e-3
9696 @test result. u[1 ][2 ] ≈ 4.96471e-5 atol= 1e-3
97+ @test result. objective[1 ] ≈ 8.6879e-9 atol= 1e-3
9798 end
9899
99100 # Test 2: Rosenbrock and Ackley Functions
108109 println (" Solution for Rosenbrock and Ackley: " , result)
109110 @test result. u[10 ][1 ] ≈ 1.0 atol= 1e-3
110111 @test result. u[10 ][2 ] ≈ 0.999739 atol= 1e-3
112+ @test result. objective[2 ] ≈ 3.625384 atol= 1e-3
111113 end
112114
113115 # Test 3: ZDT1 Function
124126 println (" Solution for ZDT1: " , result)
125127 @test result. u[1 ][1 ] ≈ - 0.365434 atol= 1e-3
126128 @test result. u[1 ][2 ] ≈ 1.22128 atol= 1e-3
129+ @test result. objective[1 ] ≈ - 0.365434 atol= 1e-3
127130 end
128131
129132 # Test 4: DTLZ2 Function
138141 println (" Solution for DTLZ2: " , result)
139142 @test result. u[1 ][1 ] ≈ 0.899183 atol= 1e-3
140143 @test result. u[2 ][1 ] ≈ 0.713992 atol= 1e-3
144+ @test result. objective[1 ] ≈ 0.1599915 atol= 1e-3
141145 end
142146
143147 # Test 5: Schaffer Function N.2
152156 println (" Solution for Schaffer N.2: " , result)
153157 @test result. u[19 ][1 ] ≈ 0.252635 atol= 1e-3
154158 @test result. u[9 ][1 ] ≈ 1.0 atol= 1e-3
159+ @test result. objective[1 ] ≈ 1.0 atol= 1e-3
155160 end
156161
157162end
You can’t perform that action at this time.
0 commit comments