schola.sb3.env.VecEnv

class schola.sb3.env.VecEnv(unreal_connection, verbosity=0)[source]

Bases: VecEnv

Methods

__init__(unreal_connection[, verbosity])

close()

Clean up the environment’s resources.

env_is_wrapped(wrapper_class[, indices])

Check if environments are wrapped with a given wrapper.

env_method(*method_args[, indices])

Call instance methods of vectorized environments.

get_attr(attr_name[, indices])

Return attribute from vectorized environment.

get_images()

Return RGB images from each environment when available

getattr_depth_check(name, already_found)

Check if an attribute reference is being hidden in a recursive call to __getattr__

render([mode])

Gym environment rendering

reset()

Reset all the environments and return an array of observations, or a tuple of observation arrays.

seed([seed])

Sets the random seeds for all environments, based on a given seed.

set_attr(attr_name, value[, indices])

Set attribute inside vectorized environments.

set_options([options])

Set the options for the environment.

step(actions)

Step the environments with the given action

step_async(actions)

Tell all the environments to start taking a step with the given actions.

step_wait()

Wait for the step taken with step_async().

Attributes

unwrapped

Parameters:

verbosity (int)

__init__(unreal_connection, verbosity=0)[source]
Parameters:

verbosity (int)

close()[source]

Clean up the environment’s resources.

Return type:

None

env_is_wrapped(wrapper_class, indices=None)[source]

Check if environments are wrapped with a given wrapper.

Parameters:
  • method_name – The name of the environment method to invoke.

  • indices – Indices of envs whose method to call

  • method_args – Any positional arguments to provide in the call

  • method_kwargs – Any keyword arguments to provide in the call

Returns:

True if the env is wrapped, False otherwise, for each env queried.

Return type:

bool

env_method(*method_args, indices=None, **method_kwargs)[source]

Call instance methods of vectorized environments.

Parameters:
  • method_name – The name of the environment method to invoke.

  • indices – Indices of envs whose method to call

  • method_args – Any positional arguments to provide in the call

  • method_kwargs – Any keyword arguments to provide in the call

Returns:

List of items returned by the environment’s method call

get_attr(attr_name, indices=None)[source]

Return attribute from vectorized environment.

Parameters:
  • attr_name – The name of the attribute whose value to return

  • indices – Indices of envs to get attribute from

Returns:

List of values of ‘attr_name’ in all environments

reset()[source]

Reset all the environments and return an array of observations, or a tuple of observation arrays.

If step_async is still doing work, that work will be cancelled and step_wait() should not be called until step_async() is invoked again.

Returns:

observation

Return type:

Dict[str, ndarray]

seed(seed=None)[source]

Sets the random seeds for all environments, based on a given seed. Each individual environment will still get its own seed, by incrementing the given seed. WARNING: since gym 0.26, those seeds will only be passed to the environment at the next reset.

Parameters:

seed (int | None) – The random seed. May be None for completely random seeding.

Returns:

Returns a list containing the seeds for each individual env. Note that all list elements may be None, if the env does not return anything when being seeded.

Return type:

None

set_attr(attr_name, value, indices=None)[source]

Set attribute inside vectorized environments.

Parameters:
  • attr_name – The name of attribute to assign new value

  • value – Value to assign to attr_name

  • indices – Indices of envs to assign value

Returns:
set_options(options=None)[source]

Set the options for the environment.

Parameters:

options (Optional[Dict[str,str]], optional) – The options to set, by default None.

Return type:

None

step_async(actions)[source]

Tell all the environments to start taking a step with the given actions. Call step_wait() to get the results of the step.

You should not call this if a step_async run is already pending.

Parameters:

actions (List[ndarray] | List[Dict[str, ndarray]])

Return type:

None

step_wait()[source]

Wait for the step taken with step_async().

Returns:

observation, reward, done, information

Return type:

Tuple[Dict[str, ndarray], ndarray, ndarray, List[Dict[str, str]]]

Related pages

  • Visit the Schola product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!