MultiAgentPrioritizedReplayBuffer.sample(num_items: int, policy_id: str | None = None, **kwargs) SampleBatch | MultiAgentBatch | Dict[str, Any] | None#

Samples a MultiAgentBatch of num_items per one policy’s buffer.

If less than num_items records are in the policy’s buffer, some samples in the results may be repeated to fulfil the batch size num_items request. Returns an empty batch if there are no items in the buffer.

  • num_items – Number of items to sample from a policy’s buffer.

  • policy_id – ID of the policy that created the experiences we sample. If

  • given (none is) –

  • policies. (sample from all) –


Concatenated MultiAgentBatch of items. **kwargs: Forward compatibility kwargs.

DeveloperAPI: This API may change across minor Ray releases.