MountainCar#
- class hybrid_aif.reference.envs.MountainCar[source]#
Bases:
EnvSparse-reward continuous Mountain Car. The dynamics constants are static fields.
- goal_position: float = 0.45#
The position at or beyond which the goal is reached (termination and success).
- gravity: float = 0.0025#
The gravity term,
gravity * cos(3 * position)subtracted from the velocity.
- time_limit: int = 100#
The agent steps per episode before truncation (at least 1), read by the collectors.
- reached_goal(state)[source]#
position >= goal_position: the termination predicate and the success flag.
- step(key, state, action, params=None)[source]#
One agent step as the
Envface:agent_step()without reward and done.
- agent_step(key, state, action, params=None)[source]#
One agent step with the sparse reward:
(obs, state, reward, done).Runs
action_repeatraw steps, freezing the state once the goal is reached.rewardis −1 per raw step taken before the goal;doneis termination at or before this step.
- __init__(
- power=0.0015,
- max_speed=0.07,
- min_position=-1.2,
- max_position=0.6,
- goal_position=0.45,
- gravity=0.0025,
- action_repeat=2,
- time_limit=100,
- reset_low=-0.6,
- reset_high=-0.4,