def __init__(
self, model_path, frame_skip=1, position_only=False,
obs_noise=0.0, action_noise=0.0, template_string=None,
template_args=None,
):
self.full_model_path = model_path
if template_string is None:
if model_path.endswith(".mako"):
with open(model_path) as template_file:
template = mako.template.Template(
template_file.read())
template_string = template.render(
opts=template_args if template_args is not None else {},
)
else:
with open(model_path, "r") as f:
template_string = f.read()
world, extra_data = world_from_xml(template_string)
self.world = world
self.extra_data = extra_data
self.initial_state = self._state
self.viewer = None
self.frame_skip = frame_skip
self.timestep = self.extra_data.timeStep
self.position_only = position_only
self.obs_noise = obs_noise
self.action_noise = action_noise
self._action_bounds = None
# cache the computation of position mask
self._position_ids = None
self._cached_obs = None
self._cached_coms = {}
评论列表
文章目录