Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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']
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
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 + '/')
def __init__(self, player_config, env_config):
player_base.PlayerBase.__init__(self, player_config)
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
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