Changeset 1289 for framspy/evolalg/run_numerical_islands_example.py
- Timestamp:
- 01/15/24 05:43:37 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/evolalg/run_numerical_islands_example.py
r1190 r1289 1 from .numerical_example.numerical_islands_example import \ 2 ExperimentNumericalIslands 1 import numpy as np 2 from .numerical_example.numerical_islands_example import ExperimentNumericalIslands 3 from .structures.individual import Individual 3 4 4 5 5 6 def main(): 6 7 parsed_args = ExperimentNumericalIslands.get_args_for_parser().parse_args() 8 Individual.fitness_set_negative_to_zero = parsed_args.fitness_set_negative_to_zero # setting the "static" field once 7 9 print("Argument values:", ", ".join( 8 10 ['%s=%s' % (arg, getattr(parsed_args, arg)) for arg in vars(parsed_args)])) 9 11 10 initialgenotype = [100, 100, 100, 100] 11 print('Best individuals:') 12 initialgenotype = np.array([100, 100, 100, 100]) 12 13 experiment = ExperimentNumericalIslands( 13 14 hof_size=parsed_args.hof_size, … … 23 24 pxov=parsed_args.pxov, 24 25 tournament_size=parsed_args.tournament) 25 print( len(hof))26 print('Best individuals:') 26 27 for ind in hof: 27 print(ind. genotype, ind.rawfitness)28 print(ind.rawfitness, '\t-->\t', ind.genotype) 28 29 29 30
Note: See TracChangeset
for help on using the changeset viewer.