Ignore:
Timestamp:
04/11/21 03:21:14 (3 years ago)
Author:
Maciej Komosinski
Message:

Introduced the number of generations as a command-line parameter; refactored; fixed a typo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/evolalg/examples/standard.py

    r1113 r1128  
    4242
    4343    parser.add_argument("-popsize", type=int, default=50, help="Size of population, default 50.")
     44    parser.add_argument('-generations', type=int, default=5, help="Number of generations, default 5.")
    4445    return parser.parse_args()
    4546
     
    9697                            )
    9798    experiment.init()
    98     experiment.run(3)
    99     for ind in hall_of_fame.haloffame:
     99    experiment.run(parsed_args.generations)
     100    for ind in hall_of_fame.halloffame:
    100101        print("%g\t%s" % (ind.fitness, ind.genotype))
    101102
Note: See TracChangeset for help on using the changeset viewer.