class_docstr: A compact implementation of a simplified Rainbow agent.
class_docstr_tok: ["A","compact","implementation","of","a","simplified","Rainbow","agent","."]
docstr: Stores a transition when in training mode.
  
  Executes a tf session and executes replay buffer ops in order to store the
  following tuple in the replay buffer (last_observation, action, reward,
  is_terminal, priority).
  
  Args:
    last_observation: Last observation, type determined via observation_type
      parameter in the replay_memory constructor.
    action: An integer, the action taken.
    reward: A float, the reward.
    is_terminal: Boolean indicating if the current state is a terminal state.
    priority: Float. Priority of sampling the transition. If None, the default
      priority will be used. If replay scheme is uniform, the default priority
      is 1. If the replay scheme is prioritized, the default priority is the
      maximum ever seen [Schaul et al., 2015].
docstr_tok: ["Stores","a","transition","when","in","training","mode",".","Executes","a","tf","session","and","executes","replay","buffer","ops","in","order","to","store","the","following","tuple","in","the","replay","buffer","(","last_observation",",","action",",","reward",",","is_terminal",",","priority",")",".","Args",":","last_observation",":","Last","observation",",","type","determined","via","observation_type","parameter","in","the","replay_memory","constructor",".","action",":","An","integer",",","the","action","taken",".","reward",":","A","float",",","the","reward",".","is_terminal",":","Boolean","indicating","if","the","current","state","is","a","terminal","state",".","priority",":","Float",".","Priority","of","sampling","the","transition",".","If","None",",","the","default","priority","will","be","used",".","If","replay","scheme","is","uniform",",","the","default","priority","is","1",".","If","the","replay","scheme","is","prioritized",",","the","default","priority","is","the","maximum","ever","seen","[","Schaul","et","al.",",","2015","]","."]
code: def _store_transition(
      self, last_observation, action, reward, is_terminal, priority=None
  ):
      """Stores a transition when in training mode.
  
      Executes a tf session and executes replay buffer ops in order to store the
      following tuple in the replay buffer (last_observation, action, reward,
      is_terminal, priority).
  
      Args:
        last_observation: Last observation, type determined via observation_type
          parameter in the replay_memory constructor.
        action: An integer, the action taken.
        reward: A float, the reward.
        is_terminal: Boolean indicating if the current state is a terminal state.
        priority: Float. Priority of sampling the transition. If None, the default
          priority will be used. If replay scheme is uniform, the default priority
          is 1. If the replay scheme is prioritized, the default priority is the
          maximum ever seen [Schaul et al., 2015].
      """
      if priority is None:
          if self._replay_scheme == "uniform":
              priority = 1.0
          else:
              priority = (
                  self._replay.memory.sum_tree.max_recorded_priority
              )
  
      if not self.eval_mode:
          self._replay.add(
              last_observation, action, reward, is_terminal, priority
          )
  
file_path: dopamine/dopamine/agents/rainbow/rainbow_agent.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from dopamine.agents.dqn import dqn_agent
  from dopamine.discrete_domains import atari_lib
  from dopamine.replay_memory import prioritized_replay_buffer
  import gin.tf
  import tensorflow
label_desc: Use image node_id 6 for calling the RainbowAgent obj's underlying member method code with example usage: obj._store_transition(last_observation, action, reward, is_terminal, priority) without return types