Changeset 1146 for framspy/evolalg/examples/niching_novelty.py
- Timestamp:
- 08/03/21 14:00:12 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/evolalg/examples/niching_novelty.py
r1145 r1146 141 141 142 142 143 def func_raw(ind): setattr(ind, "fitness", ind.fitness_raw) 144 145 146 def func_novelty(ind): setattr(ind, "fitness", ind.dissim) 147 148 149 def func_knn_novelty(ind): setattr(ind, "fitness", ind.dissim) 150 151 143 152 def func_niching(ind): setattr(ind, "fitness", ind.fitness_raw * (1 + ind.dissim)) 144 145 146 def func_raw(ind): setattr(ind, "fitness", ind.fitness_raw)147 148 149 def func_novelty(ind): setattr(ind, "fitness", ind.dissim)150 151 152 def func_knn_novelty(ind): setattr(ind, "fitness", ind.dissim)153 153 154 154 … … 180 180 new_generation_stages = [FramsCrossAndMutate(frams_lib, cross_prob=0.2, mutate_prob=0.9)] 181 181 182 # Steps after new population is created. Executed exac ly once per generation.182 # Steps after new population is created. Executed exactly once per generation. 183 183 generation_modifications = [] 184 184 … … 245 245 generation_modifications.append(raw) 246 246 247 if parsed_args.fit == Fitness.niching: 247 if parsed_args.fit == Fitness.niching: # TODO reduce redundancy in the four cases below: dictionary? 248 248 niching = UnionStep([ 249 249 dissim, … … 297 297 298 298 # ------------------------------------------------- 299 # End stages: this will execute exac ly once after all generations.299 # End stages: this will execute exactly once after all generations. 300 300 end_stages = [ 301 301 replace_with_hof,
Note: See TracChangeset
for help on using the changeset viewer.