ray.rllib.policy.sample_batch.MultiAgentBatch#

class ray.rllib.policy.sample_batch.MultiAgentBatch(policy_batches: Dict[str, SampleBatch], env_steps: int)[source]#

A batch of experiences from multiple agents in the environment.

policy_batches#

Dict mapping policy IDs to SampleBatches of experiences.

Type:

Dict[PolicyID, SampleBatch]

count#

The number of env steps in this batch.

Methods

__init__

Initialize a MultiAgentBatch instance.

agent_steps

The number of agent steps (there are >= 1 agent steps per env step).

as_multi_agent

Simply returns self (already a MultiAgentBatch).

compress

Compresses each policy batch (per column) in place.

copy

Deep-copies self into a new MultiAgentBatch.

decompress_if_needed

Decompresses each policy batch (per column), if already compressed.

env_steps

The number of env steps (there are >= 1 agent steps per env step).

size_bytes

returns:

The overall size in bytes of all policy batches (all columns).

timeslices

Returns k-step batches holding data for each agent at those steps.

to_device

TODO: transfer batch to given device as framework tensor.

wrap_as_needed

Returns SampleBatch or MultiAgentBatch, depending on given policies.