(ref_dirs, evaluator)
| 183 | |
| 184 | |
| 185 | def test_update(ref_dirs, evaluator): |
| 186 | problem = C3DTLZ4(n_var=12, n_obj=3) |
| 187 | ca_x = np.loadtxt(load_to_test_resource('ctaea', 'c3dtlz4', 'case2', 'preCA.x')) |
| 188 | CA = Population.new(X=ca_x) |
| 189 | evaluator.eval(problem, CA) |
| 190 | |
| 191 | da_x = np.loadtxt(load_to_test_resource('ctaea', 'c3dtlz4', 'case2', 'preDA.x')) |
| 192 | DA = Population.new(X=da_x) |
| 193 | evaluator.eval(problem, DA) |
| 194 | |
| 195 | off_x = np.loadtxt(load_to_test_resource('ctaea', 'c3dtlz4', 'case2', 'offspring.x')) |
| 196 | off = Population.new(X=off_x) |
| 197 | evaluator.eval(problem, off) |
| 198 | |
| 199 | post_ca_x = np.loadtxt(load_to_test_resource('ctaea', 'c3dtlz4', 'case2', 'postCA.x')) |
| 200 | true_pCA = Population.new(X=post_ca_x) |
| 201 | evaluator.eval(problem, true_pCA) |
| 202 | |
| 203 | post_da_x = np.loadtxt(load_to_test_resource('ctaea', 'c3dtlz4', 'case2', 'postDA.x')) |
| 204 | true_pDA = Population.new(X=post_da_x) |
| 205 | evaluator.eval(problem, true_pDA) |
| 206 | |
| 207 | survival = CADASurvival(ref_dirs) |
| 208 | mixed = Population.merge(CA, off) |
| 209 | survival.ideal_point = np.array([0., 0., 0.]) |
| 210 | |
| 211 | pCA, pDA = survival.do(problem, mixed, DA, len(ref_dirs)) |
| 212 | |
| 213 | pCA_X = set([tuple(x) for x in pCA.get("X")]) |
| 214 | tpCA_X = set([tuple(x) for x in true_pCA.get("X")]) |
| 215 | |
| 216 | pDA_X = set([tuple(x) for x in pDA.get("X")]) |
| 217 | tpDA_X = set([tuple(x) for x in true_pDA.get("X")]) |
| 218 | |
| 219 | assert pCA_X == tpCA_X |
| 220 | assert pDA_X == tpDA_X |
| 221 | |
| 222 | |
| 223 | def test_mating_comparison(ref_dirs, evaluator): |
nothing calls this directly
no test coverage detected
searching dependent graphs…