How to use the gfootball.env.player_base.PlayerBase.__init__ function in gfootball

To help you get started, we’ve selected a few gfootball examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google-research / football / gfootball / env / players / replay.py View on Github external
def __init__(self, player_config, env_config):
    player_base.PlayerBase.__init__(self, player_config)
    self._can_play_right = True
    self._replay = script_helpers.ScriptHelpers().load_dump(player_config['path'])
    self._step = 0
    self._player = player_config['index']
github google-research / football / gfootball / env / players / bot.py View on Github external
def __init__(self, player_config, env_config):
    assert env_config["action_set"] == 'full'
    player_base.PlayerBase.__init__(self, player_config)
    self._observation = None
    self._last_action = football_action_set.action_idle
    self._shoot_distance = 0.15
    self._pressure_enabled = False
github google-research / football / gfootball / env / players / ppo2_cnn.py View on Github external
def __init__(self, player_config, env_config):
    player_base.PlayerBase.__init__(self, player_config)

    self._action_set = (env_config['action_set']
                        if 'action_set' in env_config else 'default')
    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    self._sess = tf.Session(config=config)
    self._player_prefix = 'player_{}'.format(player_config['index'])
    stacking = 4 if player_config.get('stacked', True) else 1
    policy = player_config.get('policy', 'cnn')
    self._stacker = ObservationStacker(stacking)
    with tf.variable_scope(self._player_prefix):
      with tf.variable_scope('ppo2_model'):
        policy_fn = build_policy(DummyEnv(self._action_set, stacking), policy)
        self._policy = policy_fn(nbatch=1, sess=self._sess)
    _load_variables(player_config['checkpoint'], self._sess,
                    prefix=self._player_prefix + '/')
github google-research / football / gfootball / env / players / lazy.py View on Github external
def __init__(self, player_config, env_config):
    player_base.PlayerBase.__init__(self, player_config)
github google-research / football / gfootball / env / players / agent.py View on Github external
def __init__(self, player_config, env_config):
    player_base.PlayerBase.__init__(self, player_config)
    assert player_config['player_agent'] == 0, 'Only one \'agent\' player allowed'
    self._action = None
github google-research / football / gfootball / env / controller_base.py View on Github external
def __init__(self, player_config, env_config):
    player_base.PlayerBase.__init__(self, player_config)
    self._active_actions = {}
    self._env_config = env_config
    self._last_action = football_action_set.action_idle
    self._last_direction = football_action_set.action_idle
    self._current_direction = football_action_set.action_idle