
    h`b                         S SK Jr  S SKJr  S SKJr  S SKrS SKr	S SKJ
r
JrJr  S SKJr  S SKJr  / SQrS	r " S
 S\
5      rg)    )closing)StringIO)pathN)Envspacesutils)categorical_sample)DependencyNotInstalled)+---------+z|R: | : :G|z| : | : : |z| : : : : |z| | : | : |z|Y| : |B: |r   )i&  i^  c                      ^  \ rS rSrSr/ SQSS.rS rS rS rSS	 jr	S
 r
   S S\S-  S\S\4S jjrS rS rS\4S jrS rSSS.S\S-  S\S-  4U 4S jjjrS rS rS rS rS rSrU =r$ )!TaxiEnv   u[  
The Taxi Problem involves navigating to passengers in a grid world, picking them up and dropping them
off at one of four locations.

## Description
There are four designated pick-up and drop-off locations (Red, Green, Yellow and Blue) in the
5x5 grid world. The taxi starts off at a random square and the passenger at one of the
designated locations.

The goal is move the taxi to the passenger's location, pick up the passenger,
move to the passenger's desired destination, and
drop off the passenger. Once the passenger is dropped off, the episode ends.

The player receives positive rewards for successfully dropping-off the passenger at the correct
location. Negative rewards for incorrect attempts to pick-up/drop-off passenger and
for each step where another reward is not received.

Map:

        +---------+
        |R: | : :G|
        | : | : : |
        | : : : : |
        | | : | : |
        |Y| : |B: |
        +---------+

From "Hierarchical Reinforcement Learning with the MAXQ Value Function Decomposition"
by Tom Dietterich [<a href="#taxi_ref">1</a>].

## Action Space
The action shape is `(1,)` in the range `{0, 5}` indicating
which direction to move the taxi or to pickup/drop off passengers.

- 0: Move south (down)
- 1: Move north (up)
- 2: Move east (right)
- 3: Move west (left)
- 4: Pickup passenger
- 5: Drop off passenger

## Observation Space
There are 500 discrete states since there are 25 taxi positions, 5 possible
locations of the passenger (including the case when the passenger is in the
taxi), and 4 destination locations.

Destination on the map are represented with the first letter of the color.

Passenger locations:
- 0: Red
- 1: Green
- 2: Yellow
- 3: Blue
- 4: In taxi

Destinations:
- 0: Red
- 1: Green
- 2: Yellow
- 3: Blue

An observation is returned as an `int()` that encodes the corresponding state, calculated by
`((taxi_row * 5 + taxi_col) * 5 + passenger_location) * 4 + destination`

Note that there are 400 states that can actually be reached during an
episode. The missing states correspond to situations in which the passenger
is at the same location as their destination, as this typically signals the
end of an episode. Four additional states can be observed right after a
successful episodes, when both the passenger and the taxi are at the destination.
This gives a total of 404 reachable discrete states.

## Starting State
The initial state is sampled uniformly from the possible states
where the passenger is neither at their destination nor inside the taxi.
There are 300 possible initial states: 25 taxi positions, 4 passenger locations (excluding inside the taxi)
and 3 destinations (excluding the passenger's current location).

## Rewards
- -1 per step unless other reward is triggered.
- +20 delivering passenger.
- -10  executing "pickup" and "drop-off" actions illegally.

An action that results a noop, like moving into a wall, will incur the time step
penalty. Noops can be avoided by sampling the `action_mask` returned in `info`.

## Episode End
The episode ends if the following happens:

- Termination:
        1. The taxi drops off the passenger.

- Truncation (when using the time_limit wrapper):
        1. The length of the episode is 200.

## Information

`step()` and `reset()` return a dict with the following keys:
- p - transition probability for the state.
- action_mask - if actions will cause a transition to a new state.

For some cases, taking an action will have no effect on the state of the episode.
In v0.25.0, ``info["action_mask"]`` contains a np.ndarray for each of the actions specifying
if the action will change the state.

To sample a modifying action, use ``action = env.action_space.sample(info["action_mask"])``
Or with a Q-value based algorithm ``action = np.argmax(q_values[obs, np.where(info["action_mask"] == 1)[0]])``.

## Arguments

```python
import gymnasium as gym
gym.make('Taxi-v3')
```

<a id="is_raining"></a>`is_raining=False`: If True the cab will move in intended direction with
probability of 80% else will move in either left or right of target direction with
equal probability of 10% in both directions.

<a id="fickle_passenger"></a>`fickle_passenger=False`: If true the passenger has a 30% chance of changing
destinations when the cab has moved one square away from the passenger's source location.  Passenger fickleness
only happens on the first pickup and successful movement.  If the passenger is dropped off at the source location
and picked up again, it is not triggered again.

## References
<a id="taxi_ref"></a>[1] T. G. Dietterich, “Hierarchical Reinforcement Learning with the MAXQ Value Function Decomposition,”
Journal of Artificial Intelligence Research, vol. 13, pp. 227–303, Nov. 2000, doi: 10.1613/jair.639.

## Version History
* v3: Map Correction + Cleaner Domain Description, v0.25.0 action masking added to the reset and step information
    - In Gymnasium `1.2.0` the `is_rainy` and `fickle_passenger` arguments were added to align with Dietterich, 2000
* v2: Disallow Taxi start location = goal location, Update Taxi observations in the rollout, Update Taxi reward threshold.
* v1: Remove (3,2) from locs, add passidx<4 check
* v0: Initial version release
)humanansi	rgb_array   )render_modes
render_fpsc                 N    US:  a  XR                   U   :X  a  SnUnXE4$ UnSnXE4$ )z7Computes the new location and reward for pickup action.r   )locs)selftaxi_locpass_idxrewardnew_pass_idx
new_rewards         V/home/james-whalen/.local/lib/python3.13/site-packages/gymnasium/envs/toy_text/taxi.py_pickupTaxiEnv._pickup   sA    a<H		((;;LJ
 '' $LJ''    c                     XR                   U   :X  a  US:X  a  UnSnSnO;XR                   ;   a&  US:X  a   U R                   R                  U5      nSnUnOUnSnSnXWU4$ )z?Computes the new location and reward for return dropoff action.r   T   Fr   )r   index)r   r   r   dest_idxdefault_rewardr   new_terminatedr   s           r   _dropoffTaxiEnv._dropoff   sl    		(++Q#L!NJ))#Q99??84L"N'J#L"NJ77r!   c                 ^   U R                  XX45      nX4nXUpnSnSnUS:X  a  [        US-   U R                  5      nOUS:X  a  [        US-
  S5      nUS:X  a8  U R                  SU-   SU-  S-   4   S:X  a  [        US-   U R
                  5      n	OgUS:X  a+  U R                  SU-   SU-  4   S:X  a  [        US-
  S5      n	O6US:X  a  U R                  XzU5      u  pOUS	:X  a  U R                  XzXK5      u  pnU R                  XX5      nU R                  U   U   R                  S
XU45        g)zOComputes the next action for a state (row, col, pass_idx, dest_idx) and action.Fr            :   r            ?N)
encodeminmax_rowmaxdescmax_colr   r(   Pappend)r   rowcolr   r%   actionstater   new_rownew_colr   r   
terminated	new_states                 r   _build_dry_transitionsTaxiEnv._build_dry_transitions   s;   Ch9:),8,
Q;#'4<<0Gq[#'1oGQ;499QWa#gk%9:dB#'4<<0Gq[TYYq3wC'78D@#'1oGq[#'<<#O L&q[/3}}0,L* KK,I	uf$$c9j%IJr!   c                     Uu  pV[        S[        X-   U R                  5      5      n[        S[        X&-   U R                  5      5      nU R                  SU-   SU-  U-   4   S:X  a  Xx4$ X4$ )z>Calculates the new position for a row and col to the movement.r   r,   r-   r.   )r5   r3   r4   r7   r6   )	r   r:   r;   movementoffsetdrdcr>   r?   s	            r   _calc_new_positionTaxiEnv._calc_new_position   sn    aSXt||45aSXt||4599Q[!g+"6674?##8Or!   c                    U R                  XX45      nX4=n=pXUpn
SnSnSSSSS.nUS;   dE  US	:X  a  U R                  S
U-   S	U-  S	-   4   S:X  d!  US:X  a  U R                  S
U-   S	U-  4   S:X  a~  X   S   u  nn[        S[        UU-   U R                  5      5      n
[        S[        UU-   U R
                  5      5      nU R                  XX   S
   S	S9nU R                  XX   S	   5      n	O6US:X  a  U R                  X|U5      u  pOUS:X  a  U R                  X|XM5      u  pnU R                  XX5      nUS::  a  U R                  US   US
   X5      nU R                  U	S   U	S
   X5      nU R                  U   U   R                  SUSU45        U R                  U   U   R                  SUSU45        U R                  U   U   R                  SUSU45        gU R                  U   U   R                  SUX45        g)z^Computes the next action for a state (row, col, pass_idx, dest_idx) and action for `is_rainy`.r+   F)r,   r   r   r+   r   r,   )r+   r   rM   rN   )rN   rL   rO   )rM   rL   rO   r   r,   r-   r/   >   r   r,   r-   r,   r.   r/   r   )rF   r   r0   g?g?r1   N)r2   r6   r5   r3   r4   r7   rI   r   r(   r8   r9   )r   r:   r;   r   r%   r<   r=   r   left_pos	right_posr>   r?   r   r   r@   movesrG   rH   intended_state
left_stateright_states                        r   _build_rainy_transitions TaxiEnv._build_rainy_transitions   s8   Ch9+.*448),8,
 ))()	
 f!		!c'1s7Q;*> ?4 G!		!c'1s7*: ;t C]1%FB!Sr4<<89G!Sr4<<89G..sq9IRS.TH//%-:JKIq[#'<<#O L&q[/3}}0,L* W|NQ;Xa[(1+|VJ++!ilLK FF5M&!((#~r:)NOFF5M&!((#z2z)JKFF5M&!((#{B
)KLFF5M&!((#~v)RSr!   Nrender_modeis_rainyfickle_passengerc                 p   [         R                  " [        SS9U l        / SQ=U l        n/ SQU l        SnSnSnUS-
  U l        US-
  U l        [         R                  " U5      U l	        Sn[        U5       V	V
s0 s H   n	U	[        U5       V
s0 s H  o/ _M     sn
_M"     sn
n	U l        [        U5       H  n[        U5       H  n[        [        U5      S-   5       H  n[        [        U5      5       H|  nU R                  XX5      n	US	:  a  X:w  a  U R                  U	==   S-  ss'   [        U5       H6  n
U(       a  U R                  UUUUU
5        M!  U R                  UUUUU
5        M8     M~     M     M     M     U =R                  U R                  R!                  5       -  sl	        ["        R$                  " U5      U l        ["        R$                  " U5      U l        Xl        X0l        U R,                  =(       a    U R.                  R1                  5       S
:  U l        S U l        S U l        [8        S   U R                  R:                  S   -  [8        S   U R                  R:                  S   -  4U l        S U l        SU l         S U l!        S U l"        S U l#        S U l$        S U l%        g s  sn
f s  sn
n	f )Ncdtype))r   r   )r   r   )r   r   )r   r/   ))   r   r   )r   r`   r   )r`   r`   r   )r   r   r`   i  r0   r,      r   333333?r   )&npasarrayMAPr6   r   locs_colorsr4   r7   zerosinitial_state_distribranger8   lenr2   rW   rB   sumr   Discreteaction_spaceobservation_spacerY   r[   	np_randomrandomfickle_stepwindowclockWINDOW_SIZEshape	cell_size	taxi_imgstaxi_orientationpassenger_imgdestination_imgmedian_horizmedian_vertbackground_img)r   rY   rZ   r[   r   
num_statesnum_rowsnum_columnsnum_actionsr=   r<   r:   r;   r   r%   s                  r   __init__TaxiEnv.__init__  sv    JJs#.	;;	DQ
!|"Q%'XXj%9" z*
* U;-?@-?6BJ-?@@*

 ?C[) %c$i!m 4H$)#d)$4 $Ch I#a<H,@ 66u=B=&+K&8F' $ = =$'$'$,$,$*!" !% ; ;$'$'$,$,$*!" '9	 %5 !5 * #0 	""d&@&@&D&D&FF""OOK8!'!<& 000RT^^5J5J5Ls5R 
NTYY__Q//NTYY__Q//
  !!# "c A
s   8J2J-J2-J2c                 @    UnUS-  nXR-  nUS-  nXS-  nUS-  nXT-  nU$ )Nr0   r    )r   taxi_rowtaxi_colpass_locr%   is         r   r2   TaxiEnv.encode]  s<    	Q		Q		Q	r!   c                     / nUR                  US-  5        US-  nUR                  US-  5        US-  nUR                  US-  5        US-  nUR                  U5        SUs=::  a  S:  d   e   e[        U5      $ )Nr   r0   r   )r9   reversed)r   r   outs      r   decodeTaxiEnv.decodeh  s|    

1q5F

1q5F

1q5F

1Azzzz}r!   r=   c                    [         R                  " S[         R                  S9nU R                  U5      u  p4pVUS:  a  SUS'   US:  a  SUS'   US:  a#  U R                  US-   SU-  S-   4   S:X  a  SUS'   US:  a   U R                  US-   SU-  4   S:X  a  SUS'   US:  a  X44U R
                  U   :X  a  SUS'   US:X  a*  X44U R
                  U   :X  d  X44U R
                  ;   a  SUS	'   U$ )
zIComputes an action mask for the action space using the state information.ra   r^   r   r,   r   r-   r.   r/   r0   )rc   rg   int8r   r6   r   )r   r=   maskr   r   r   r%   s          r   action_maskTaxiEnv.action_maskt  s   xx)15U1C.Ha<DGa<DGa<DIIhlAL14D&DEMDGa<DIIhlAL&@ATIDGa<X0DIIh4GGDGq= DIIh$77#tyy0DGr!   c                    U R                   U R                     U   n[        U Vs/ s H  o3S   PM	     snU R                  5      nX$   u  pVpsXl        U R                  U R                  5      u  ppU R                  U5      u  ppU R                  (       a  U R                  (       az  U
S:X  at  X:w  d  X:w  aj  SU l        [        [        U R                  5      5       Vs/ s H  oDU:w  d  M
  UPM     nnU R                  R                  U5      nU R                  XUU5      nX`l        U R                  S:X  a  U R                  5         [        U5      XsSXPR!                  U5      S.4$ s  snf s  snf )Nr   r   Fr   probr   )r8   sr	   ro   
lastactionr   r[   rq   ri   rj   r   choicer2   rY   renderintr   )r   atransitionstr   pr   r
shadow_row
shadow_colshadow_pass_locshadow_dest_idxr   r   r   _possible_destinationsr%   s                     r   stepTaxiEnv.step  sA   ffTVVnQ'k:k!k:DNNK ^
aCG;;tvvCV@
*.++a.'H
 !!  1$'8+A$D TYY0%0a4H0 " % ~~,,-BCHH(CAw&KKM1vqUQ?O?OPQ?R$SSS7  ; %s   E'	E,+E,)seedoptionsr   r   c                  > [         TU ]  US9  [        U R                  U R                  5      U l        S U l        U R                  =(       a    U R                  R                  5       S:  U l	        SU l
        U R                  S:X  a  U R                  5         [        U R
                  5      SU R                  U R
                  5      S.4$ )N)r   rb   r   r   r1   r   )superresetr	   rh   ro   r   r   r[   rp   rq   rx   rY   r   r   r   )r   r   r   	__class__s      r   r   TaxiEnv.reset  s     	4 #D$>$>O00RT^^5J5J5Ls5R !w&KKM466{S9I9I$&&9QRRRr!   c                     U R                   cG  U R                  c   e[        R                  R	                  SU R                  R
                   S35        g U R                   S:X  a  U R                  5       $ U R                  U R                   5      $ )NzYou are calling render method without specifying any render mode. You can specify the render_mode at initialization, e.g. gym.make("z", render_mode="rgb_array")r   )rY   specgymloggerwarnid_render_text_render_gui)r   s    r   r   TaxiEnv.render  s    #99(((JJOO""&)),,/JL
 '$$&&##D$4$455r!   c                     SS K nU R                  cv  UR	                  5         UR
                  R                  S5        US:X  a%  UR
                  R                  [        5      U l        O US:X  a  UR                  [        5      U l        U R                  c   S5       eU R                  c  UR                  R                  5       U l
        U R                  Gc  [        R                  " [        R                   " ["        5      S5      [        R                  " [        R                   " ["        5      S5      [        R                  " [        R                   " ["        5      S	5      [        R                  " [        R                   " ["        5      S
5      /nU Vs/ s HB  nUR$                  R'                  UR(                  R+                  U5      U R,                  5      PMD     snU l        U R.                  cs  [        R                  " [        R                   " ["        5      S5      nUR$                  R'                  UR(                  R+                  U5      U R,                  5      U l        U R0                  c  [        R                  " [        R                   " ["        5      S5      nUR$                  R'                  UR(                  R+                  U5      U R,                  5      U l        U R0                  R3                  S5        U R4                  c  [        R                  " [        R                   " ["        5      S5      [        R                  " [        R                   " ["        5      S5      [        R                  " [        R                   " ["        5      S5      /nU Vs/ s HB  nUR$                  R'                  UR(                  R+                  U5      U R,                  5      PMD     snU l        U R6                  c  [        R                  " [        R                   " ["        5      S5      [        R                  " [        R                   " ["        5      S5      [        R                  " [        R                   " ["        5      S5      /nU Vs/ s HB  nUR$                  R'                  UR(                  R+                  U5      U R,                  5      PMD     snU l        U R8                  cs  [        R                  " [        R                   " ["        5      S5      nUR$                  R'                  UR(                  R+                  U5      U R,                  5      U l        U R:                  n[=        SUR>                  S   5       GH$  n[=        SUR>                  S   5       GH  nXR,                  S   -  XpR,                  S   -  4n	U R                  RA                  U R8                  U	5        Xg   U   S:X  a?  US:X  d  XgS-
     U   S:w  a+  U R                  RA                  U R6                  S   U	5        M  Xg   U   S:X  aN  XvR>                  S   S-
  :X  d  XgS-      U   S:w  a+  U R                  RA                  U R6                  S   U	5        M  Xg   U   S:X  a,  U R                  RA                  U R6                  S   U	5        GM&  Xg   U   S:X  a@  US:X  d  Xg   US-
     S:w  a,  U R                  RA                  U R4                  S   U	5        GMq  Xg   U   S:X  aO  XR>                  S   S-
  :X  d  Xg   US-      S:w  a,  U R                  RA                  U R4                  S   U	5        GM  Xg   U   S:X  d  GM  U R                  RA                  U R4                  S   U	5        GM     GM'     [C        U RD                  U RF                  5       Hy  u  pUR                  U R,                  5      nUR3                  S5        URI                  U
5        U RK                  U	5      nU R                  RA                  XS   US   S-   45        M{     U RM                  U RN                  5      u  pnnUS:  aB  U R                  RA                  U R.                  U RK                  U RD                  U   5      5        U RP                  S;   a  U RP                  U l)        U RK                  U RD                  U   5      nU RK                  X45      nUS   US   ::  au  U R                  RA                  U R0                  US   US   U R,                  S   S-  -
  45        U R                  RA                  U R                  U RR                     U5        OtU R                  RA                  U R                  U RR                     U5        U R                  RA                  U R0                  US   US   U R,                  S   S-  -
  45        US:X  a]  URT                  RW                  5         UR
                  RY                  5         U R                  R[                  U R\                  S   5        g US:X  aL  [^        R`                  " [^        Rb                  " URd                  Rg                  U R                  5      5      SS9$ g ! [         a  n[        S5      UeS nAff = fs  snf s  snf s  snf ) Nr   z@pygame is not installed, run `pip install "gymnasium[toy-text]"`Taxir   r   z;Something went wrong with pygame. This should never happen.zimg/cab_front.pngzimg/cab_rear.pngzimg/cab_right.pngzimg/cab_left.pngzimg/passenger.pngzimg/hotel.png   zimg/gridworld_median_left.pngzimg/gridworld_median_horiz.pngzimg/gridworld_median_right.pngzimg/gridworld_median_top.pngzimg/gridworld_median_vert.pngzimg/gridworld_median_bottom.pngzimg/taxi_background.pngr,      |r-      -   
   r   rP   r   )r,   r   r-   )axes)4pygameImportErrorr
   rr   initdisplayset_captionset_modert   Surfacers   timeClockrw   r   joindirname__file__	transformscaleimageloadrv   ry   rz   	set_alphar{   r|   r}   r6   ri   ru   blitzipr   rf   fillget_surf_locr   r   r   rx   eventpumpupdatetickmetadatarc   	transposearray	surfarraypixels3d)r   moder   e
file_names	file_namer6   yxcellcolor
color_celllocr   r   r   r%   dest_loctaxi_locations                      r   r   TaxiEnv._render_gui  s]   	 ;;KKMNN&&v.w$nn55kB$$nn[9 KK#	IH	I#::**,DJ>>!		$,,x02EF		$,,x02DE		$,,x02EF		$,,x02DE	J ",!+I   &&v||'8'8'CT^^T!+DN %		$,,x"8:MNI!'!1!1!7!7!!),dnn"D '		$,,x"8/JI#)#3#3#9#9!!),dnn$D    **3/$		$,,x02QR		$,,x02RS		$,,x02RSJ ",!!+I   &&v||'8'8'CT^^T!+!D #		$,,x02PQ		$,,x02QR		$,,x02STJ ", !+I   &&v||'8'8'CT^^T!+ D &		$,,x"8:STI"("2"2"8"8!!),dnn#D yyq$**Q-(A1djjm,NN1--q>>!3D/DE  !4!4d;71:%16Ta%[^t5KKK$$T%5%5a%8$?WQZ4'A**dq5k!n.DKK$$T%5%5a%8$?WQZ4'KK$$T%5%5a%8$?WQZ4'Q!Vtwq1u~7MKK$$T%6%6q%94@WQZ4'A**dga!en.DKK$$T%6%6q%94@WQZ4'KK$$T%6%6q%94@% - )* tyy$*:*:;KD7J  %OOE"##D)CKKZa&#a&2+)>? < 26TVV1D.Hha<KKT//1B1B499XCV1WX??l*$(OOD!$$TYYx%89))8*>?A;-**KK$$!hqkDNN1,=,BBC KKT^^D,A,ABMRKKT^^D,A,ABMRKK$$!hqkDNN1,=,BBC
 7?LLNN!!#JJOODMM,78[ <<))224;;?@y  !w  	(R	2*! s,   j+ A	k	A	kA	k+
k5kkc                 h    US   S-  S-   U R                   S   -  US   S-   U R                   S   -  4$ )Nr,   r-   r   )rv   )r   map_locs     r   r   TaxiEnv.get_surf_locI  sF    
Q"dnnQ&77AJNNN1:  	r!   c           
         U R                   R                  5       R                  5       n[        5       nU VVs/ s H#  o3 Vs/ s H  oDR	                  S5      PM     snPM%     nnnU R	                  U R
                  5      u  pgpS n
US:  az  [        R                  " USU-      SU-  S-      SSS9USU-      SU-  S-   '   U R                  U   u  p[        R                  " USU-      SU-  S-      S	SS
9USU-      SU-  S-   '   O:[        R                  " U
" USU-      SU-  S-      5      SSS9USU-      SU-  S-   '   U R                  U	   u  p[        R                  " USU-      SU-  S-      S5      USU-      SU-  S-   '   UR                  SR                  U Vs/ s H  nSR                  U5      PM     sn5      S-   5        U R                  b%  UR                  S/ SQU R                      S35        OUR                  S5        [        U5         UR                  5       sS S S 5        $ s  snf s  snnf s  snf ! , (       d  f       g = f)Nzutf-8c                     U S:X  a  S$ U $ )N r   r   )r   s    r   ul TaxiEnv._render_text.<locals>.ulU  s    s(3))r!   r   r,   r-   yellowT)	highlightblue)boldgreenmagenta
 z  ()SouthNorthEastWestPickupDropoffz)
)r6   copytolistr   r   r   r   colorizer   writer   r   r   getvalue)r   r6   outfileliner]   r   r   r   r   r%   r   pipjdidjr:   s                   r   r   TaxiEnv._render_textN  s:   yy~~&&(*=ABTT404a!40TB15TVV1D.H	* a<27..AL!!h,"23X3CHa(lQ./ YYx(FB&+nnAFAFQJ'd'CBKB
# 38..3q8|$Q\A%567D3CHa(lQ./ 8$"'..QVQVaZ1H)"TAFAFQJdii =# =>EF??&MMMdoo^__bc MM$W##% ; 1B* !> s)   	H6H1H6 H<I1H6
Ic                 |    U R                   b/  SS KnUR                  R                  5         UR                  5         g g )Nr   )rr   r   r   quit)r   r   s     r   closeTaxiEnv.closer  s-    ;;"NN!KKM	 #r!   )r8   rm   r}   rv   rs   r6   rz   r[   rq   rh   r   r   rf   r7   r4   r{   r|   rn   ry   rY   r   rw   rx   rr   )r   )NFF)__name__
__module____qualname____firstlineno____doc__r   r   r(   rB   rI   rW   strboolr   r2   r   r   r   r   dictr   r   r   r   r   r  __static_attributes____classcell__)r   s   @r   r   r      s    EP 7H
	(8"K6.Td #'!&	D#4ZD# D# 	D#L	
 *TD  #	S DjS 	S S 6AF
"&H r!   r   )
contextlibr   ior   osr   numpyrc   	gymnasiumr   r   r   r   gymnasium.envs.toy_text.utilsr	   gymnasium.errorr
   re   rt   r   r   r!   r   <module>r$     s<         ( ( < 2 ^	c ^	r!   