def execute(argv):
    'Generate genetic sequences for each benchmark'
    del argv
    FLAGS = flags.FLAGS
    benchmarks = IO.load_yaml(FLAGS.benchmarks_filename)
    if (not benchmarks):
        logging.error('There are no benchmarks to process')
        sys.exit(1)
    if (not os.path.isdir(FLAGS.benchmarks_directory)):
        logging.error('Benchmarks directory {} does not exist.'.format(FLAGS.benchmarks_directory))
        sys.exit(1)
    try:
        os.makedirs(FLAGS.results_directory)
    except FileExistsError:
        pass
    sga = SGA(FLAGS.generations, FLAGS.population, FLAGS.cr, FLAGS.m, FLAGS.param_m, FLAGS.param_s, FLAGS.crossover, FLAGS.mutation, FLAGS.selection, FLAGS.seed, FLAGS.dimension, FLAGS.passes_filename, Goals.prepare_goals(FLAGS.goals, FLAGS.weights), 'opt', FLAGS.benchmarks_directory, FLAGS.working_set, FLAGS.times, FLAGS.tool, FLAGS.verify_output)
    for benchmark in tqdm(benchmarks, desc='Processing'):
        index = benchmark.find('.')
        bench_dir = benchmark[:index]
        bench_name = benchmark[(index + 1):]
        bench_dir = os.path.join(FLAGS.results_directory, bench_dir)
        try:
            os.makedirs(bench_dir)
        except FileExistsError:
            pass
        filename = '{}/{}.yaml'.format(bench_dir, bench_name)
        if (FLAGS.verify_report and os.path.isfile(filename)):
            continue
        sga.run(benchmark)
        if sga.results:
            IO.dump_yaml(sga.results, filename, FLAGS.report_only_the_best)
Generate genetic sequences for each benchmark
def execute(argv):
    
    del argv
    FLAGS = flags.FLAGS
    benchmarks = IO.load_yaml(FLAGS.benchmarks_filename)
    if (not benchmarks):
        logging.error('There are no benchmarks to process')
        sys.exit(1)
    if (not os.path.isdir(FLAGS.benchmarks_directory)):
        logging.error('Benchmarks directory {} does not exist.'.format(FLAGS.benchmarks_directory))
        sys.exit(1)
    try:
        os.makedirs(FLAGS.results_directory)
    except FileExistsError:
        pass
    sga = SGA(FLAGS.generations, FLAGS.population, FLAGS.cr, FLAGS.m, FLAGS.param_m, FLAGS.param_s, FLAGS.crossover, FLAGS.mutation, FLAGS.selection, FLAGS.seed, FLAGS.dimension, FLAGS.passes_filename, Goals.prepare_goals(FLAGS.goals, FLAGS.weights), 'opt', FLAGS.benchmarks_directory, FLAGS.working_set, FLAGS.times, FLAGS.tool, FLAGS.verify_output)
    for benchmark in tqdm(benchmarks, desc='Processing'):
        index = benchmark.find('.')
        bench_dir = benchmark[:index]
        bench_name = benchmark[(index + 1):]
        bench_dir = os.path.join(FLAGS.results_directory, bench_dir)
        try:
            os.makedirs(bench_dir)
        except FileExistsError:
            pass
        filename = '{}/{}.yaml'.format(bench_dir, bench_name)
        if (FLAGS.verify_report and os.path.isfile(filename)):
            continue
        sga.run(benchmark)
        if sga.results:
            IO.dump_yaml(sga.results, filename, FLAGS.report_only_the_best)