class_docstr: Implements agentwise termination signal and n-step learning.
class_docstr_tok: ["Implements","agentwise","termination","signal","and","n-step","learning","."]
code: def postprocess_trajectory(
      self, sample_batch, other_agent_batches=None, episode=None
  ):
      # FIXME: Get done from info is required since agentwise done is not
      #  supported now.
      sample_batch[SampleBatch.TERMINATEDS] = self.get_done_from_info(
          sample_batch[SampleBatch.INFOS]
      )
  
      # N-step Q adjustments
      if self.config["n_step"] > 1:
          adjust_nstep(
              self.config["n_step"], self.config["gamma"], sample_batch
          )
  
      return sample_batch
  
imports: import logging
  import numpy
  from gymnasium.spaces import Box, Discrete
  from ray.rllib.algorithms.dqn.dqn_tf_policy import minimize_and_clip
  from ray.rllib.evaluation.postprocessing import adjust_nstep
  from ray.rllib.models import ModelCatalog
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.tf_policy import TFPolicy
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.error import UnsupportedSpaceException
  from ray.rllib.utils.framework import try_import_tf, try_import_tfp
  from ray.rllib.utils.metrics.learner_info import LEARNER_STATS_KEY
label_desc: Use image node_id 1 for calling the MADDPGPostprocessing obj's underlying member method code with example usage: obj.postprocess_trajectory(sample_batch, other_agent_batches, episode) and returns: sample_batch