File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 83
83
Random. seed! (rng, 1 )
84
84
off = [mut (copy (ex), rng= rng) for i in 1 : 10 ]
85
85
@testset " Offspring Height" for i in 1 : 10
86
- @test all (o-> Evolutionary. height (o) <= H, map (o-> mut (o,rng= rng), off))
86
+ map (o-> mut (o,rng= rng), off) # mutate offspring
87
+ @test all (o-> Evolutionary. height (o) <= H, off)
87
88
end
88
89
89
90
# subtree mutation does not produce offspring expression longer then the parent
90
91
mut = subtree (tr; growth= 0.5 )
91
92
Random. seed! (rng, 2 )
92
93
off = [mut (copy (ex), rng= rng) for i in 1 : 10 ]
93
94
@testset " Offspring Height (Growth)" for i in 1 : 5
94
- @test all (o-> Evolutionary. height (o) <= 3 i, map (o-> mut (o,rng= rng), off))
95
+ map (o-> mut (o,rng= rng), off) # mutate offspring
96
+ h = map (Evolutionary. height, off)
97
+ @test all (h .<= 3 + i)
95
98
end
96
99
97
100
# hoist
103
106
@testset " Hoist Mutation" for i in 1 : 10
104
107
n = length (off[i])
105
108
m = length (mut (off[i], rng= rng))
106
- @test n > m
109
+ @test n >= m
107
110
end
108
111
109
112
# shrink
You can’t perform that action at this time.
0 commit comments