Changeset 1296


Ignore:
Timestamp:
02/23/24 04:48:57 (2 months ago)
Author:
Maciej Komosinski
Message:

Niching and novelty techniques currently require Individual.fitness_set_negative_to_zero = True

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/evolalg/tests/test_diferent_settings.py

    r1292 r1296  
    99from ..numerical_example.numerical_example import ExperimentNumerical
    1010from ..numerical_example.numerical_islands_example import ExperimentNumericalIslands
     11from ..structures.individual import Individual
    1112
    1213from ..utils import ensureDir
     
    119120                  "max_numgenochars": params['max_numgenochars'],
    120121                  }
     122                 
     123    old_fitness_set_negative_to_zero = Individual.fitness_set_negative_to_zero # save a copy of the current value to restore later
     124    Individual.fitness_set_negative_to_zero = True # niching must have it set to True, see "-fitness_set_negative_to_zero" argument in experiment_abc.py
    121125
    122126    experiment = ExperimentFramsNiching(frams_lib=framsLib,
     
    140144                      pxov=params['pxov'],
    141145                      tournament_size=params['tournament'])
     146   
     147    Individual.fitness_set_negative_to_zero = old_fitness_set_negative_to_zero # restore original value
    142148
    143149def test_run_experiment_frams_island(params):
Note: See TracChangeset for help on using the changeset viewer.