Changeset 1290 for framspy/evolalg/numerical_example/numerical_example.py
 Timestamp:
 01/15/24 05:45:10 (6 weeks ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

framspy/evolalg/numerical_example/numerical_example.py
r1190 r1290 2 2 3 3 from ..base.experiment_abc import ExperimentABC 4 from ..structures.hall_of_fame import HallOfFame5 4 6 5 … … 11 10 save_only_best=save_only_best) 12 11 13 def mutate(self, gen 1):14 return list(gen1 + np.random.randint(10, 10, len(gen1)))12 def mutate(self, gen): 13 return gen + np.random.normal(0, 15, len(gen)) 15 14 16 15 def cross_over(self, gen1, gen2): 17 return gen1 16 a = np.random.uniform() 17 return a * gen1 + (1.0a) * gen2 18 18 19 def evaluate(self, gen otype):20 return 1/sum([x*x for x in genotype])19 def evaluate(self, gen): 20 return sum([x*x for x in gen])
Note: See TracChangeset
for help on using the changeset viewer.