utils.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:RobotNSGA 作者: LuisLaraP 项目源码 文件源码
def initialize_database(args, default_dir):
    '''Performs the necessary checks and initialization procedures to initialize the database

    Returns the database to be used.
    '''
    if args.database is None:
        args.database = default_dir
    ret_db = Database(args.database)
    if args.reset:
        ret_db.reset()
    if ret_db.properties['highest_population'] == 0:
        if args.size is None:
            print('ERROR: Population size must be specified when starting a new run.')
            sys.exit()
        ret_db.set_property('population_size', args.size)
    else:
        ret_db.select()
    return ret_db
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号