Ignore:
Timestamp:
04/11/21 03:27:06 (22 months ago)
Author:
Maciej Komosinski
Message:

Introduced tournament size as a command-line parameter

File:
1 edited

Legend:

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

    r1128 r1129  
    4141                        help='Genetic format for the demo run, for example 4, 9, or B. If not given, f1 is assumed.')
    4242
    43     parser.add_argument("-popsize", type=int, default=50, help="Size of population, default 50.")
     43    parser.add_argument("-popsize", type=int, default=50, help="Population size, default 50.")
    4444    parser.add_argument('-generations', type=int, default=5, help="Number of generations, default 5.")
     45    parser.add_argument('-tournament', type=int, default=5, help="Tournament size, default 5.")
    4546    return parser.parse_args()
    4647
     
    7879                   statistics_union]
    7980
    80     selection = TournamentSelection(5, copy=True, fit_attr="fitness")
     81    selection = TournamentSelection(parsed_args.tournament, copy=True, fit_attr="fitness")
    8182
    8283    new_generation_steps = [
Note: See TracChangeset for help on using the changeset viewer.