コード例 #1
0
def run(args):
    genes = utils.get_genes_from(args.cities_fn)

    if args.verbose:
        print("-- Running Model with {} cities --".format(len(genes)))

    history = ga.run_ga(genes, args.pop_size, args.n_gen,
                        args.tourn_size, args.mut_rate, args.verbose)

    if args.verbose:
        print("-- Drawing Route --")

    utils.plot(history['cost'], history['route'])

    if args.verbose:
        print("-- Done --")
コード例 #2
0
def run(args):
    genes = utils.get_genes_from(args.cities_fn)

    history = ga.run_ga(genes, args.pop_size, args.n_gen, args.tourn_size,
                        args.mut_rate, args.verbose)