Experiments with a new royal road function (Contingent Parities) that support the Generative Fixation theory of adaptation and the Hypomixability theory of recombination.
A companion blog post (When will evolution outperform local search?) introduces Contingent Parities Functions and compares the behavior of recombinative evolution and simulated annealing on a member of this class of fitness function.
Simulated annealing and a genetic algorithm can be run on a contingent parities function of order 2 and height 100 as follows:
import royalroads as rr
rr.SA(rngSeed=1, numPeriods=1000)
import royalroads as rr
rr.GA(rngSeed=1, numGenerations=1000, useClamping=False)
import royalroads as rr
rr.compareAlgorithms(numRuns=40)
mmh3, matplotlib, joblib