
    ni                         S r SSKJr  SSKJr  SSKJr  SSKJs  Jr  SSK	J
r
   " S S\R                  R                  5      r\S	:X  a  \R                  R                  5         gg)
z#Tests for the simulation operation.    )absolute_import)division)print_functionN)toolsc                   2    \ rS rSrS rS rS rS rS rSr	g)	SimulateTest   c                 :   U R                  S5      n[        R                  " U5      n[        R                  " XSSS9u  n  nU R	                  5        nUR                  [        R                  " 5       5        U R                  / SQUR                  U5      5        U R                  / SQUR                  U5      5        U R                  / SQUR                  U5      5        U R                  / SQUR                  U5      5        S S S 5        g ! , (       d  f       g = f)N            Flogreset)TFFF)TTFF)TFTF)TTFT)	_create_test_batch_envr   MockAlgorithmsimulatetest_sessionruntfglobal_variables_initializerassertAllEqualself	batch_envalgodone_sesss         k/home/james-whalen/.local/lib/python3.13/site-packages/pybullet_envs/minitaur/agents/tools/simulate_test.pytest_done_automatic SimulateTest.test_done_automatic   s    ++L9Iy)D	U%HJD!Q				
hhr..01
5txx~F
4dhhtnE
4dhhtnE
3TXXd^D 
		s   B1D
Dc           	      F   [         R                  " SS5      nU R                  S5      n[        R                  " U5      n[        R
                  " X#SU5      u  n  nU R                  5        nUR                  [         R                  " 5       5        U R                  SS/UR                  U5      5        U R                  SS/UR                  XAS05      5        U R                  SS/UR                  U5      5        U R                  SS/UR                  XAS05      5        U R                  SS/UR                  U5      5        U R                  SS/UR                  U5      5        U R                  SS/UR                  U5      5        S S S 5        g ! , (       d  f       g = f)NF r   r   T)
r   placeholder_with_defaultr   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   s          r"   test_done_forcedSimulateTest.test_done_forced&   sI   ''r2E++F3Iy)D	>JD!Q				
hhr..01
5%.$((4.9
5%.$((4*GH
4-$8
5%.$((4*GH
4-$8
5%.$((4.9
4,7 
		s   +DF
F c                 p   U R                  S5      n[        R                  " U5      n[        R                  " XSSS9u  n  nU R	                  5        nUR                  [        R                  " 5       5        [        S5       H  nUR                  U5        M     S S S 5        U R                  / SQUS   R                  5        U R                  / SQUS   R                  5        U R                  / S	QUS
   R                  5        U R                  / SQUS   R                  5        g ! , (       d  f       N= f)Nr   Fr   
   )
r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   )r   r   r   r   r   r   r   r   ranger   stepsr   s         r"   test_reset_automatic!SimulateTest.test_reset_automatic5   s    ++L9Iy)D	U%HJD!Q				
hhr..01Ry!  
 	6	!8J8JK1););<il&8&89	9Q<#5#56 
	s   AD''
D5c                    [         R                  " SS5      nU R                  S5      n[        R                  " U5      n[        R
                  " X#SU5      u  n  nU R                  5        nUR                  [         R                  " 5       5        UR                  U5        UR                  XAS05        UR                  U5        UR                  XAS05        UR                  U5        UR                  U5        UR                  U5        S S S 5        U R                  / SQUS   R                  5        U R                  / SQUS   R                  5        g ! , (       d  f       NQ= f)	NFr&   r'   T)r   r   r   r   r   )r   r   r   r   )r   r(   r   r   r   r   r   r   r   r   r/   r)   s          r"   test_reset_forcedSimulateTest.test_reset_forcedB   s
   ''r2E++F3Iy)D	>JD!Q				
hhr..01
hhtn
hhtT]#
hhtn
hhtT]#
hhtn
hhtn
hhtn 
 	il&8&89	9Q<#5#56 
	s   +B E
E$c                     / nU HJ  n[         R                  " SSUUS9n[         R                  R                  U5      nUR	                  U5        ML     [         R
                  " USS9n[         R                  " U5      nU$ )N)r   r   )r   )observ_shapeaction_shapemin_durationmax_durationT)blocking)r   MockEnvironmentwrappersConvertTo32BitappendBatchEnvInGraphBatchEnv)r   	durationsenvsdurationenvr   s         r"   r   #SimulateTest._create_test_batch_envS   sv    D!!v/3/7/79c NN))#.c
kk#  td3I%%i0I    r&   N)
__name__
__module____qualname____firstlineno__r#   r*   r0   r3   r   __static_attributes__r&   rF   r"   r   r      s    	E877"rF   r   __main__)__doc__
__future__r   r   r   tf.compat.v1compatv1r   .google3.robotics.reinforcement_learning.agentsr   testTestCaser   rG   mainr&   rF   r"   <module>rV      sQ    * &  %   @E277## EP z'',,. rF   