Namespace Gym.Environments.Envs.ToyText
Classes
- BlackjackEnv
Blackjack-v1: beat the dealer without going over 21. The player hits (1) or sticks (0); a hit that busts loses (-1.0), sticking plays the dealer's hand out (drawing below 17) and scores the game (1.0 win, -1.0 loss, 0.0 draw).
naturalpays 1.5 for a winning natural blackjack;sab(Sutton and Barto's rules, Blackjack-v1's registered default, which overridesnatural) makes a natural against a dealer without one an automatic win. Byte for byte what Gymnasium's Blackjack computes: the cards drawn from the generator (an infinite deck,np_random.choice), the face-up card's suit and face, observations, rewards andrgb_arraypixels.
- BlackjackEnvOptions
The keyword arguments of BlackjackEnv's constructor as a typed record (DR-34), generated from the constructor so it cannot drift from it. A property that is set becomes a keyword argument by its Python name; one left unset is not passed, so
makekeeps the registered spec's value and the constructor its default.
- BlackjackObservation
A Blackjack observation read by name (DR-13): Gymnasium's
(player_sum, dealer_card, usable_ace), each item a 0-d int64 array (DR-08). BlackjackEnv returns Gym.NET's generic tuple, object?[] (what itsTupleobservation space samples and every space tool reads); assigning one to this record converts it:BlackjackObservation obs = env.Reset().Observation;.
- CliffWalkingEnv
CliffWalking-v1 and CliffWalkingSlippery-v1: a 4x12 grid walked from the bottom-left corner to the bottom-right one along a cliff; stepping off it costs -100 and returns the agent to the start, every other step costs -1. Slippery moves go perpendicular with probability 2/3. Byte for byte what Gymnasium's CliffWalking computes: the transition table P, the generator draws, observations, rewards,
{"prob": p}infos,ansitext andrgb_arraypixels.
- CliffWalkingEnvOptions
The keyword arguments of CliffWalkingEnv's constructor as a typed record (DR-34), generated from the constructor so it cannot drift from it. A property that is set becomes a keyword argument by its Python name; one left unset is not passed, so
makekeeps the registered spec's value and the constructor its default.
- CliffWalkingInfo
CliffWalking's info (CliffWalkingEnv, CliffWalking-v1 and CliffWalkingSlippery-v1), typed (DR-91):
{"prob": ...}.
- FrozenLakeEnv
FrozenLake-v1 and FrozenLake8x8-v1: walk from the start
Sto the goalGacross a frozen lake without falling into a holeH; on slippery ice a move goes perpendicular with probability1 - success_rate. Byte for byte what Gymnasium's FrozenLake computes: the transition table P, the generator draws, observations, rewards,{"prob": p}infos,ansitext andrgb_arraypixels.
- FrozenLakeEnvOptions
The keyword arguments of FrozenLakeEnv's constructor as a typed record (DR-34), generated from the constructor so it cannot drift from it. A property that is set becomes a keyword argument by its Python name; one left unset is not passed, so
makekeeps the registered spec's value and the constructor its default.
- FrozenLakeInfo
FrozenLake's info (FrozenLakeEnv, FrozenLake-v1 and FrozenLake8x8-v1), typed (DR-91):
{"prob": ...}.
- TaxiEnv
Taxi-v4: drive a taxi on a 5x5 grid with walls, pick a passenger up at one of four stands (R, G, Y, B) and drop them at their destination: -1 per step, -10 for a wrong pickup or dropoff, 20 for delivering. Byte for byte what Gymnasium's Taxi computes: the 500-state transition table P (dry or rainy), the fickle passenger, the generator draws, observations, rewards,
{"prob", "action_mask"}infos,ansitext andrgb_arraypixels.
- TaxiEnvOptions
The keyword arguments of TaxiEnv's constructor as a typed record (DR-34), generated from the constructor so it cannot drift from it. A property that is set becomes a keyword argument by its Python name; one left unset is not passed, so
makekeeps the registered spec's value and the constructor its default.
- TaxiInfo
Taxi's info (TaxiEnv, Taxi-v4), typed (DR-91):
{"prob": ..., "action_mask": ...}on every reset and step.
- ToyTextInfo
The base of the toy_text envs' typed info records (DR-91, DR-95): the transition's probability,
prob, which FrozenLake, CliffWalking and Taxi send on every reset and step, as their transition tables give it (P[s][a] = [(prob, next, reward, terminated)]). Blackjack sends{}and has no record.
- ToyTextTransition
One possible outcome of an action in a toy_text env's transition table
P[s][a]: Gymnasium's 4-tuple(probability, next_state, reward, terminated), in the order Gymnasium lists the outcomes.
- ToyTextUtils
Gymnasium's
gymnasium.envs.toy_text.utils(CategoricalSample(IReadOnlyList<double>, Generator)) and the character maps the toy_text envs build their worlds from (CharMap(IReadOnlyList<string>)).