Storing the fitness values
While the weights tuple defines the fitness strategy, a matching tuple, called values, is used to contain the actual fitness values within the base.Fitness class. These values are obtained from a separately defined function, typically called evaluate(), as will be described later in this chapter. Just like the weights tuple, the values tuple contains one value for each fitness component (objective).
A third tuple, wvalues, contains the weighted values obtained by multiplying each component of the values tuple with its matching component of the weights tuple. Whenever the fitness values of an instance are set, the weighted values are calculated and inserted into wvalues. These are used internally for comparison operations ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access