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