Changeset 1140 for framspy/evolalg


Ignore:
Timestamp:
05/08/21 20:10:15 (4 years ago)
Author:
Maciej Komosinski
Message:

Introduced a parameter for the size of the hall of fame

Location:
framspy/evolalg/examples
Files:
2 edited

Legend:

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

    r1139 r1140  
    7777    parser.add_argument('-max_numconnections', type=int, default=None, help="Maximum number of Neural connections. Default: no limit")
    7878
     79    parser.add_argument('-hof_size', type=int, default=10, help="Number of genotypes in Hall of Fame. Default: 10.")
    7980    parser.add_argument('-hof_evaluations', type=int, default=20, help="Number of final evaluations of each genotype in Hall of Fame to obtain reliable (averaged) fitness. Default: 20.")
    8081    parser.add_argument('-checkpoint_path', required=False, default=None, help="Path to the checkpoint file")
     
    243244    # -------------------------------------------------
    244245    # Statistics
    245     hall_of_fame = HallOfFameStatistics(100, "fitness_raw")  # Wrapper for halloffamae
     246    hall_of_fame = HallOfFameStatistics(parsed_args.hof_size, "fitness_raw")  # Wrapper for halloffamae
    246247    replace_with_hof = ReplaceWithHallOfFame(hall_of_fame)
    247248    statistics_deap = StatisticsDeap([
  • framspy/evolalg/examples/standard.py

    r1133 r1140  
    77# TODO extend both standard.py and steadystate.py to support >1 criteria (using DEAP's selNSGA2() and selSPEA2())
    88# TODO add comments to all examples in this directory
    9 # TODO add to standard.py and steadystate.py evaluating each genotype in HOF N (configurable, default 10) times when the evolution ends instead of evaluating the last population as it is now in niching_novelty.py
    10 # TODO "debug" mode, displaying Step-based class names and their arguments so it is easy to see what happens during evolution
     9# TODO add to standard.py and steadystate.py evaluating each genotype in HOF N (configurable, default 20) times when the evolution ends, as it is in niching_novelty.py
     10# TODO "--debug" mode, indent nested steps (pre++, post-- of a static counter?) and print their arguments so it is easy to see what happens during evolution
    1111
    1212
     
    4343                        help='optimization criteria : vertpos, velocity, distance, vertvel, lifespan, numjoints, numparts, numneurons, numconnections (or other as long as it is provided by the .sim file and its .expdef). Single or multiple criteria.')
    4444    parser.add_argument('-lib', required=False, help="Filename of .so or .dll with the Framsticks library")
     45
    4546    parser.add_argument('-genformat', required=False, default="1",
    4647                        help='Genetic format for the demo run, for example 4, 9, or B. If not given, f1 is assumed.')
     
    4950    parser.add_argument('-generations', type=int, default=5, help="Number of generations, default 5.")
    5051    parser.add_argument('-tournament', type=int, default=5, help="Tournament size, default 5.")
     52
     53    parser.add_argument('-hof_size', type=int, default=10, help="Number of genotypes in Hall of Fame. Default: 10.")
    5154    return parser.parse_args()
    5255
     
    6568    frams_lib = FramsticksLib(parsed_args.path, parsed_args.lib, parsed_args.sim)
    6669
    67     hall_of_fame = HallOfFameStatistics(100, "fitness")
     70    hall_of_fame = HallOfFameStatistics(parsed_args.hof_size, "fitness")
    6871    statistics_union = UnionStep([
    6972        hall_of_fame,
Note: See TracChangeset for help on using the changeset viewer.