def gen(self, parameter_s='', local_ns=None): """ Run the genetic algorithm minimization - stub """ from shell_colors import red ## take care of arguments try: args = parse_arg_string('gen', parameter_s) except DocoptExit: print de_usage.lstrip() return except SystemExit: return ngen = int(args.pop('--ngen')) npop = int(args.pop('--npop')) if 'default' in local_ns: system = local_ns['default'] else: msg = red('ERROR: ') + 'Set a default system or provide a system '+\ 'name with the -n option' clogger.fatal(msg) return core.do_genetic(system, npop=npop, ngen=ngen) system.do_plot_fit()
def gen(self, parameter_s='', local_ns=None): """ Run the genetic algorithm minimization - stub """ from shell_colors import red if local_ns.has_key('default'): system = local_ns['default'] core.do_genetic(system) else: msg = red('ERROR: ') + 'Set a default system or provide a system '+\ 'name with the -n option' clogger.fatal(msg) return system.do_plot_fit()