Ignore:
Timestamp:
08/10/21 00:48:18 (5 weeks ago)
Author:
Maciej Komosinski
Message:

Added exception when popsize is not a multiple of 4 (required by deap.tools.selTournamentDCD())

File:
1 edited

Legend:

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

    r1147 r1148  
    168168def create_experiment():
    169169    parsed_args = parseArguments()
    170     frams_lib = FramsticksLib(parsed_args.path, parsed_args.lib,
    171                               parsed_args.sim)
     170    frams_lib = FramsticksLib(parsed_args.path, parsed_args.lib, parsed_args.sim)
    172171
    173172    opt_dissim = []
     
    303302    print("Running experiment with", sys.argv)
    304303    parsed_args = parseArguments()
     304   
     305    if parsed_args.popsize % 4 != 0:
     306        raise ValueError("popsize must be a multiple of 4 (for example %d)." % (parsed_args.popsize//4*4)) # required by deap.tools.selTournamentDCD()
     307       
    305308    if parsed_args.debug:
    306309        logging.basicConfig(level=logging.DEBUG)
     
    308311    if parsed_args.checkpoint_path is not None and os.path.exists(parsed_args.checkpoint_path):
    309312        experiment = load_experiment(parsed_args.checkpoint_path)
    310         FramsticksLib(parsed_args.path, parsed_args.lib,
    311                       parsed_args.sim)
     313        FramsticksLib(parsed_args.path, parsed_args.lib, parsed_args.sim)
    312314    else:
    313315        experiment = create_experiment()
Note: See TracChangeset for help on using the changeset viewer.