GMUEClab/ecj

FloatVectorSpecies Mutation Parameters Silently Ignored in Segments

Closed this issue · 1 comments

This is an issue that has tripped me up more than once over several years of using ECJ: with the exception of mutation-prob, the parameters of mutation operators for FloatVectorSpecies are silently ignore if no mutation-type is explicitly specified for the segment.

pop.subpop.0.species.segment.0.start = 0                                                                                                                                          
pop.subpop.0.species.segment.0.mutation-type = gauss                                                                                                                              
pop.subpop.0.species.segment.0.mutation-prob = 0.5                                                                                                                                
# This mutation-stdev is read correctly, because mutation-type is specified                                                                                                            
pop.subpop.0.species.segment.0.mutation-stdev = 0.1                                                                                                                               
                                                                                                                                                                                  
pop.subpop.0.species.segment.1.start = 2                                                                                                                                          
pop.subpop.0.species.segment.1.mutation-prob = 0.067                                                                                                                              
# This mutation-stdev is silently ignored, because mutation-type is not specified                                                                                                      
pop.subpop.0.species.segment.1.mutation-stdev = -0.001    

The mutation type is typically inherited from the global setting, so there is a strong temptation to omit it.

I once tried to fix this by re-writing ECJ's segments mechanism from scratch in a cleaner way, such that global settings were seamlessly inherited for all parameters. It might be worth attempting that again.

This seems to only bother me, and "rewriting ECJ's segments mechanism" is non-trivial. Closing.