-
Notifications
You must be signed in to change notification settings - Fork 2
/
__init__.py
45 lines (40 loc) · 1.22 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
import gin
import gym as legacy_gym
import gymnasium as gym
import pkg_resources
base_url_path = pkg_resources.resource_filename('a2perf.domains.web_navigation',
'gwob')
config_file_path = pkg_resources.resource_filename(
'a2perf', 'domains/web_navigation/configs/web_navigation_env_config.gin'
)
base_url = f'file://{base_url_path}/'
data_dir = pkg_resources.resource_filename(
'a2perf.domains.web_navigation.environment_generation', 'data')
gin.parse_config_files_and_bindings(
[config_file_path], None, finalize_config=False
)
gym.envs.register(
id='WebNavigation-v0',
entry_point=(
'a2perf.domains.web_navigation.gwob.CoDE.environment:WebNavigationEnv'
),
apply_api_compatibility=False,
disable_env_checker=False,
kwargs=dict(
use_legacy_step=False,
use_legacy_reset=False,
data_dir=data_dir,
base_url=base_url),
)
legacy_gym.envs.register(
id='WebNavigation-v0',
entry_point=(
'a2perf.domains.web_navigation.gwob.CoDE.environment:WebNavigationEnv'
),
kwargs=dict(
use_legacy_step=True,
use_legacy_reset=True,
data_dir=data_dir,
base_url=base_url),
)