One problem with such "protected division" and similar operators is that
they introduce a hidden overhead when using the results of GP in C and
The overhead may not be an issue (depending on the target platform and
the problem you are solving), but it is somewhat inelegant.
Claes Gyllenswärd wrote:
> In "A field guide to genetic programming" returning 1 is
> "recommended". This has historically been used as a way to easily give
> the GP access to 1.
> This seems somewhat crude to me, but if it works for Langdon, it
> probably works for me. I do this.
> 2010/3/29 adil raja <[log in to unmask]>:
>> A good way to deal is to return a NaN value from the divison operator.
>> This way the whole tree will return a NaN value and when ever that happens
>> assign an poor fitness to such an individual. Evolution is going to take
>> care of the rest.
>> Best Regards,
>> Adil Raja
>> From: cheese mokney <[log in to unmask]>
>> To: [log in to unmask]
>> Sent: Sat, March 27, 2010 5:59:33 PM
>> Subject: How to deal with dividing by 0 in symbolic regression
>> Hi there,
>> In a symbolic regression genetic program, like in tutorial 4, how might you
>> deal with dividing by 0?
David R White
Dept. of Computer Science
University of York,
Heslington, YO10 5DD
+44 (0)1904 434771