Esempio n. 1
0
def bng(seed, generations, render, show, time_limit):
    l.info('Starting BeamNG.AI with seed: {}'.format(seed))

    # Ensure the right configurations are there
    # Force the use of BeamNG.AI
    config.ex.ai_controlled = 'true'

    # TODO: we should use the tool-competition framework as a runner
    factory = gen_beamng_runner_factory(config.ex.get_level_dir(), config.ex.host, config.ex.port, plot=show)

    # TODO: we need to consider the projection to (x,y) coordinates for the tool-competition framework
    experiments.experiment(seed, generations, factory, render=render, show=show, time_limit=time_limit)
Esempio n. 2
0
def ext(seed, generations, render, show, time_limit, ctrl):
    l.info('Starting external AI {} with seed: {}'.format(ctrl, seed))

    # Ensure the right confiruations are there
    # Do not use super-fast-time
    config.ex.max_speed = 'false'
    # Do not use BeamNG.AI
    config.ex.ai_controlled = 'false'
    # TODO No idea what this
    # config.ex.direction_agnostic_boundary = True

    factory = gen_beamng_runner_factory(config.ex.get_level_dir(), config.ex.host, config.ex.port, plot=show, ctrl=ctrl)
    experiments.experiment(seed, generations, factory, render=render, show=show, time_limit=time_limit)
Esempio n. 3
0
def bng(seed, generations, render, show, time_limit):
    l.info('Starting BeamNG.AI with seed: {}'.format(seed))

    # Ensure the right configurations are there
    # Force the use of BeamNG.AI
    config.ex.ai_controlled = 'true'

    factory = gen_beamng_runner_factory(config.ex.get_level_dir(),
                                        config.ex.host,
                                        config.ex.port,
                                        plot=show)
    experiments.experiment(seed,
                           generations,
                           factory,
                           render=render,
                           show=show,
                           time_limit=time_limit)
Esempio n. 4
0
def ext(seed, generations, render, uniq, time_limit, ctrl):
    l.info('Starting external evolve with seed: {}'.format(seed))
    l.info('Time limit will be enforced at: {}'.format(time_limit))
    l.info('AI Controller call given is: %s', ctrl)

    # plots_dir = config.rg.get_plots_path()
    # tests_dir = config.rg.get_tests_path()

    level_dir = config.ex.get_level_dir()

    # config.ev.join_probability = 1.1
    # config.ev.lane_width = 4.3
    # if uniq:
    #     config.ev.evaluator = 'uniqlanedist'
    # else:
    #     config.ev.evaluator = 'lanedist'
    # config.ev.try_all_ops = False
    config.ex.max_speed = 'false'
    config.ex.ai_controlled = 'false'
    config.ex.direction_agnostic_boundary = True

    rng = random.Random()
    rng.seed(seed)

    factory = gen_beamng_runner_factory(level_dir,
                                        config.ex.host,
                                        config.ex.port,
                                        False,
                                        ctrl=ctrl)

    # evaluator = LaneDistanceEvaluator()
    # selector = TournamentSelector(rng, 2)
    # estimator = TurnAndLengthEstimator()
    # experiments.experiment_out(rng, evaluator, selector, estimator, factory,
    #                            True, generations, render=render)
    budget = generations
    experiments.experiment(seed,
                           budget,
                           time_limit=time_limit,
                           render=render,
                           show=False,
                           factory=factory)
Esempio n. 5
0
def bng(seed, budget, render, show):
    l.info('Starting experiment with seed: %s', seed)
    l.info('Starting experiment with budget: %s', budget)
    experiments.experiment(seed, budget, render, show)