ray.rllib.evaluation.sampler.AsyncSampler#

class ray.rllib.evaluation.sampler.AsyncSampler(*, worker: RolloutWorker, env: ray.rllib.env.base_env.BaseEnv, clip_rewards: Union[bool, float], rollout_fragment_length: int, count_steps_by: str = 'env_steps', callbacks: DefaultCallbacks, multiple_episodes_in_batch: bool = False, normalize_actions: bool = True, clip_actions: bool = False, observation_fn: Optional[ObservationFunction] = None, sample_collector_class: Optional[Type[ray.rllib.evaluation.collectors.sample_collector.SampleCollector]] = None, render: bool = False, blackhole_outputs: bool = False, policies=None, policy_mapping_fn=None, preprocessors=None, obs_filters=None, tf_sess=None, no_done_at_end=- 1, horizon=- 1, soft_horizon=- 1)[source]#

Bases: threading.Thread, ray.rllib.evaluation.sampler.SamplerInput

Async SamplerInput that collects experiences in thread and queues them.

Once started, experiences are continuously collected in the background and put into a Queue, from where they can be unqueued by the caller of get_data().

Methods

__init__(*, worker, env, clip_rewards, ...)

Initializes an AsyncSampler instance.

isAlive()

Return whether the thread is alive.

is_alive()

Return whether the thread is alive.

join([timeout])

Wait until the thread terminates.

start()

Start the thread's activity.

tf_input_ops([queue_size])

Returns TensorFlow queue ops for reading inputs from this reader.

Attributes

daemon

A boolean value indicating whether this thread is a daemon thread.

ident

Thread identifier of this thread or None if it has not been started.

name

A string used for identification purposes only.