Using DEAP with continuous functions
The DEAP framework can be used for optimizing continuous functions in a very similar manner to what we have seen so far, when we solved discrete search problems. All that’s needed are a few subtle modifications.
For the chromosome encoding, we can use a list (or array) of floating-point numbers. One thing to keep in mind, though, is that the existing genetic operators of DEAP will not work well with individual objects extending the numpy.ndarray
class due to the way these objects are being sliced, as well as the way they are being compared to each other.
Using numpy.ndarray
-based individuals will require redefining the genetic operators accordingly. This is further covered in the DEAP documentation, under Inheriting from NumPy. For this reason, as well as for performance reasons, ordinary Python lists or arrays of floating-point numbers are generally preferred when using DEAP.
As for real-coded genetic operators, the DEAP framework...