
    h|                         S r SSKrSSKJr         SS\R
                  S\R
                  S\S\S\S	\S
\S\S\S\4S jjr	g)z^A set of tests to help the designer of gymnasium environments verify that they work correctly.    N)data_equivalenceenv_aenv_b	num_stepsseedskip_obsskip_rewskip_terminalskip_truncatedskip_renderinfo_comparisonc
                 4   U=(       d9    U R                   R                  S;   =(       d    UR                   R                  S;   nU	S;   d   eU R                  UR                  :X  d   eU(       d  UR                  UR                  :X  d   eU R                  R                  U5        U R                  US9u  pUR                  US9u  pU(       d  [        X5      (       d   SU
 SU 35       eU	S:X  a  [        X5      (       d   SU SU 35       eOU	S	:X  a3  U H,  n[        X   X   5      (       a  M   S
U SX    SX    35       e   OU	S:X  aL  UR                  5       UR                  5       :X  d)   SUR                  5        SUR                  5        35       eOQU	S:X  aK  UR                  5       UR                  5       :  d)   SUR                  5       UR                  5       -
   35       eU(       d;  U R                  5       UR                  5       :H  R                  5       (       d   S5       e[        U5       GH  nU R                  R                  5       nU R                  U5      u  n
nnnnUR                  U5      u  nnnnnU(       d   [        X5      (       d   SU SU
 SU 35       eU(       d!  [        UU5      (       d   SU SU SU 35       eU(       d  UU:X  d   SU SU SU 35       eU(       d  UU:X  d   SU SU SU 35       eU	S:X  a!  [        X5      (       d   SU SU SU 35       eOU	S	:X  a6  U H/  n[        X   X   5      (       a  M   S U S!U SX    SX    35       e   OU	S:X  aO  UR                  5       UR                  5       :X  d,   S"U S#UR                  5        SUR                  5        35       eOTU	S:X  aN  UR                  5       UR                  5       :  d,   S$U S%UR                  5       UR                  5       -
   35       eU(       d;  U R                  5       UR                  5       :H  R                  5       (       d   S&5       eU(       d  U(       d  U(       d
  U(       d  GMB  U R                  US9u  pUR                  US9u  pU(       d   [        X5      (       d   S'U SU
 SU 35       eU	S:X  a!  [        X5      (       d   S(U SU SU 35       eOU	S	:X  a6  U H/  n[        X   X   5      (       a  M   S)U S!U SX    SX    35       e   OU	S:X  aO  UR                  5       UR                  5       :X  d,   S*U S#UR                  5        SUR                  5        35       eOTU	S:X  aN  UR                  5       UR                  5       :  d,   S+U S%UR                  5       UR                  5       -
   35       eU(       a  GM  U R                  5       UR                  5       :H  R                  5       (       a  GM   S,5       e   g-).a  Checks if the environments `env_a` & `env_b` are identical.

Args:
    env_a: First environment to check.
    env_b: Second environment to check.
    num_steps: number of timesteps to test for, setting to 0 tests only resetting.
    seed: used the seed the reset & actions.
    skip_obs: If `True` it does not check for equivalence of the observation.
    skip_rew: If `True` it does not check for equivalence of the observation.
    skip_terminal: If `True` it does not check for equivalence of the observation.
    skip_truncated: If `True` it does not check for equivalence of the observation.
    skip_info: If `True` it does not check for equivalence of the observation.
    skip_render: If `True` it does not check for equivalent renders. note:the render checked are automatically skipped if `render_mode` is not set or is "human".
    info_comparison: The options are
        If "equivalence" then checks if the `info`s are identical,
        If "superset" checks if `info_b` is a (non-strict) superset of `info_a`
        If "keys-equivalence" checks if the `info`s keys are identical (while ignoring the values).
        If "keys-superset" checks if the `info_b`s keys are a superset of `info_a`'s keys.
        If "skip" no checks are made at the `info`.
)Nhuman)equivalencesupersetskipzkeys-equivalencekeys-superset)r   z9resetting observation is not equivalent, observation_a = z, observation_b = r   z+resetting info is not equivalent, info_a = z, info_b = r   z&resetting info is not a superset, key z  present in info_a with value = z, in info_b with value = zkeys-equivalancez:resetting info keys are not equivalent, info_a's keys are z, info_b's keys are r   zHresetting info keys are not a superset, keys not present in info_b are: z"resetting render is not equivalentz1stepping observation is not equivalent in step = z, observation_a = z,stepping reward is not equivalent in step = z, reward_a = z, reward_b = z.stepping terminal is not equivalent in step = z, terminal_a = z, terminal_b = z/stepping truncated is not equivalent in step = z, truncated_a = z, truncated_b = z*stepping info is not equivalent in step = z, info_a = z*stepping info is not a superset in step = z, key z0stepping info keys are not equivalent in step = z, info_a's keys are z0stepping info keys are not a superset in step = z", keys not present in info_b are: z2stepping render is not equivalent in step = {step}z2resetting observation is not equivalent in step = z+resetting info is not equivalent in step = z+resetting info is not a superset in step = z1resetting info keys are not equivalent in step = z1resetting info keys are not a superset in step = z3resetting render is not equivalent in step = {step}N)	unwrappedrender_moderenderaction_spaceobservation_spacer   resetr   keysallrangesamplestep)r   r   r   r   r   r	   r
   r   r   r   obs_ainfo_aobs_binfo_bkeyr   actionrew_a
terminal_atruncated_arew_b
terminal_btruncated_bs                          S/home/james-whalen/.local/lib/python3.13/site-packages/gymnasium/utils/env_match.pycheck_environments_matchr,      s   B 	 	5??&&/9	5??!!_4       !3!3333u..%2I2IIII	D!KKTK*MEKKTK*ME'  d	B5'I[\a[bcd  -'
 
 	U8F8T	U 
 
J	&C#V[  Q7u<\]c]h\i  jC  DJ  DO  CP  QQ   
.	.KKMV[[]*	{GVjkqkvkvkxjyz	{*	O	+KKMV[[]*	vUV\VaVaVcflfqfqfsVsUtu	v* LLNelln,
#% 	65	6  i ##**,8=

68J5uj+v8=

68J5uj+v+
 
 	x>tfDVW\V]]opuovw	x 
 +5
 
 	i9$}UGS`af`gh	i 
 Z:5	y;D6Q[P\\klvkwx	y5 k[8	~<TFBRS^R__op{o|}	~8m+#  i;D6VHT_`f_ghi  
*'K  e?vVC5Ppqwq|p}  ~W  X^  Xc  Wd  ee    22.OA$G[\b\g\g\i[jj~  @F  @K  @K  @M  N  OO./.JA$Gijpjujujw  {A  {F  {F  {H  kH  jI  JJ.%,,.0ce JIJ  
kk!KKTK2ME!KKTK2ME/    }CD6I[\a[bbtuzt{|}  -/'  n@kRXQYYdekdlmn  !J.!C+V[  jDTF&QTPUUuv|  wB  vC  C\  ]c  ]h  \i  jj  " !$66KKMV[[]2TFtfL`agalalan`o  pD  EK  EP  EP  ER  DS  TT2 O3KKMV[[]2OFtfLnouozozo|  @F  @K  @K  @M  pM  oN  OO2;LLNelln4#%  ONO } !    )r   FFFFFr   )
__doc__	gymnasiumgymgymnasium.utils.env_checkerr   Envintboolstrr,    r-   r+   <module>r7      s    d  8  (OO77OO77OO OO 	OO
 OO OO OO OO OO OOr-   