)
def main ( env_name ) :
def test_run_environment ( env_name ) :
"""
Run the low - level API test using the specified environment
: param env_name : Name of the Unity environment binary to launch
else :
# Should never happen
action = None
if tracked_agent == - 1 and len ( decision_steps ) > 1 :
if tracked_agent == - 1 and len ( decision_steps ) > = 1 :
tracked_agent = decision_steps . agent_id [ 0 ]
env . set_actions ( group_name , action )
env . step ( )
env . close ( )
def test_closing ( env_name ) :
"""
Run the low - level API and close the environment
: param env_name : Name of the Unity environment binary to launch
"""
try :
env1 = UnityEnvironment (
file_name = env_name , base_port = 5006 , no_graphics = True , args = [ " -logFile " , " - " ]
)
env1 . close ( )
env1 = UnityEnvironment (
file_name = env_name , base_port = 5006 , no_graphics = True , args = [ " -logFile " , " - " ]
)
env2 = UnityEnvironment (
file_name = env_name , base_port = 5007 , no_graphics = True , args = [ " -logFile " , " - " ]
)
env2 . reset ( )
finally :
env1 . close ( )
env2 . close ( )
main ( args . env )
test_run_environment ( args . env )
test_closing ( args . env )