class_docstr: Agent returning constant action values (specification key: `constant`).
  
  Args:
      states (specification): States specification
          (<span style="color:#C00000"><b>required</b></span>, better implicitly specified via
          `environment` argument for `Agent.create(...)`), arbitrarily nested dictionary of state
          descriptions (usually taken from `Environment.states()`) with the following attributes:
          <ul>
          <li><b>type</b> (<i>"bool" | "int" | "float"</i>) &ndash; state data type
          (<span style="color:#00C000"><b>default</b></span>: "float").</li>
          <li><b>shape</b> (<i>int | iter[int]</i>) &ndash; state shape
          (<span style="color:#C00000"><b>required</b></span>).</li>
          <li><b>num_values</b> (<i>int > 0</i>) &ndash; number of discrete state values
          (<span style="color:#C00000"><b>required</b></span> for type "int").</li>
          <li><b>min_value/max_value</b> (<i>float</i>) &ndash; minimum/maximum state value
          (<span style="color:#00C000"><b>optional</b></span> for type "float").</li>
          </ul>
      actions (specification): Actions specification
          (<span style="color:#C00000"><b>required</b></span>, better implicitly specified via
          `environment` argument for `Agent.create(...)`), arbitrarily nested dictionary of
          action descriptions (usually taken from `Environment.actions()`) with the following
          attributes:
          <ul>
          <li><b>type</b> (<i>"bool" | "int" | "float"</i>) &ndash; action data type
          (<span style="color:#C00000"><b>required</b></span>).</li>
          <li><b>shape</b> (<i>int > 0 | iter[int > 0]</i>) &ndash; action shape
          (<span style="color:#00C000"><b>default</b></span>: scalar).</li>
          <li><b>num_values</b> (<i>int > 0</i>) &ndash; number of discrete action values
          (<span style="color:#C00000"><b>required</b></span> for type "int").</li>
          <li><b>min_value/max_value</b> (<i>float</i>) &ndash; minimum/maximum action value
          (<span style="color:#00C000"><b>optional</b></span> for type "float").</li>
          </ul>
      max_episode_timesteps (int > 0): Upper bound for numer of timesteps per episode
          (<span style="color:#00C000"><b>default</b></span>: not given, better implicitly
          specified via `environment` argument for `Agent.create(...)`).
  
      action_values (dict[value]): Constant value per action
          (<span style="color:#00C000"><b>default</b></span>: false for binary boolean actions,
          0 for discrete integer actions, 0.0 for continuous actions).
  
      config (specification): Additional configuration options:
          <ul>
          <li><b>name</b> (<i>string</i>) &ndash; Agent name, used e.g. for TensorFlow scopes
          (<span style="color:#00C000"><b>default</b></span>: "agent").
          <li><b>device</b> (<i>string</i>) &ndash; Device name
          (<span style="color:#00C000"><b>default</b></span>: TensorFlow default).
          <li><b>seed</b> (<i>int</i>) &ndash; Random seed to set for Python, NumPy (both set
          globally!) and TensorFlow, environment seed may have to be set separately for fully
          deterministic execution
          (<span style="color:#00C000"><b>default</b></span>: none).</li>
          <li><b>buffer_observe</b> (<i>false | "episode" | int > 0</i>) &ndash; Number of
          timesteps within an episode to buffer before calling the internal observe function, to
          reduce calls to TensorFlow for improved performance
          (<span style="color:#00C000"><b>default</b></span>: configuration-specific maximum
          number which can be buffered without affecting performance).</li>
          <li><b>always_apply_exploration</b> (<i>bool</i>) &ndash; Whether to always apply
          exploration, also for independent `act()` calls (final value in case of schedule)
          (<span style="color:#00C000"><b>default</b></span>: false).</li>
          <li><b>always_apply_variable_noise</b> (<i>bool</i>) &ndash; Whether to always apply
          variable noise, also for independent `act()` calls (final value in case of schedule)
          (<span style="color:#00C000"><b>default</b></span>: false).</li>
          <li><b>enable_int_action_masking</b> (<i>bool</i>) &ndash; Whether int action options
          can be masked via an optional "[ACTION-NAME]_mask" state input
          (<span style="color:#00C000"><b>default</b></span>: true).</li>
          <li><b>create_tf_assertions</b> (<i>bool</i>) &ndash; Whether to create internal
          TensorFlow assertion operations
          (<span style="color:#00C000"><b>default</b></span>: true).</li>
          </ul>
      recorder (path | specification): Traces recordings directory, or recorder configuration with
          the following attributes (see
          [record-and-pretrain script](https://github.com/tensorforce/tensorforce/blob/master/examples/record_and_pretrain.py)
          for example application)
          (<span style="color:#00C000"><b>default</b></span>: no recorder):
          <ul>
          <li><b>directory</b> (<i>path</i>) &ndash; recorder directory
          (<span style="color:#C00000"><b>required</b></span>).</li>
          <li><b>frequency</b> (<i>int > 0</i>) &ndash; how frequently in episodes to record
          traces (<span style="color:#00C000"><b>default</b></span>: every episode).</li>
          <li><b>start</b> (<i>int >= 0</i>) &ndash; how many episodes to skip before starting to
          record traces (<span style="color:#00C000"><b>default</b></span>: 0).</li>
          <li><b>max-traces</b> (<i>int > 0</i>) &ndash; maximum number of traces to keep
          (<span style="color:#00C000"><b>default</b></span>: all).</li>
class_docstr_tok: ["Agent","returning","constant","action","values","(","specification","key",":","`","constant","`",")",".","Args",":","states","(","specification",")",":","States","specification","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",",","better","implicitly","specified","via","`","environment","`","argument","for","`","Agent.create","(","...",")","`",")",",","arbitrarily","nested","dictionary","of","state","descriptions","(","usually","taken","from","`","Environment.states","(",")","`",")","with","the","following","attributes",":","<","ul",">","<","li",">","<","b",">","type","<","\/b",">","(","<","i",">","''","bool","''","|","``","int","''","|","``","float","''","<","\/i",">",")","&","ndash",";","state","data","type","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","``","float","''",")",".","<","\/li",">","<","li",">","<","b",">","shape","<","\/b",">","(","<","i",">","int","|","iter","[","int","]","<","\/i",">",")","&","ndash",";","state","shape","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","<","\/li",">","<","li",">","<","b",">","num_values","<","\/b",">","(","<","i",">","int",">","0","<","\/i",">",")","&","ndash",";","number","of","discrete","state","values","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">","for","type","``","int","''",")",".","<","\/li",">","<","li",">","<","b",">","min_value\/max_value","<","\/b",">","(","<","i",">","float","<","\/i",">",")","&","ndash",";","minimum\/maximum","state","value","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","optional","<","\/b",">","<","\/span",">","for","type","``","float","''",")",".","<","\/li",">","<","\/ul",">","actions","(","specification",")",":","Actions","specification","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",",","better","implicitly","specified","via","`","environment","`","argument","for","`","Agent.create","(","...",")","`",")",",","arbitrarily","nested","dictionary","of","action","descriptions","(","usually","taken","from","`","Environment.actions","(",")","`",")","with","the","following","attributes",":","<","ul",">","<","li",">","<","b",">","type","<","\/b",">","(","<","i",">","''","bool","''","|","``","int","''","|","``","float","''","<","\/i",">",")","&","ndash",";","action","data","type","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","<","\/li",">","<","li",">","<","b",">","shape","<","\/b",">","(","<","i",">","int",">","0","|","iter","[","int",">","0","]","<","\/i",">",")","&","ndash",";","action","shape","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","scalar",")",".","<","\/li",">","<","li",">","<","b",">","num_values","<","\/b",">","(","<","i",">","int",">","0","<","\/i",">",")","&","ndash",";","number","of","discrete","action","values","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">","for","type","``","int","''",")",".","<","\/li",">","<","li",">","<","b",">","min_value\/max_value","<","\/b",">","(","<","i",">","float","<","\/i",">",")","&","ndash",";","minimum\/maximum","action","value","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","optional","<","\/b",">","<","\/span",">","for","type","``","float","''",")",".","<","\/li",">","<","\/ul",">","max_episode_timesteps","(","int",">","0",")",":","Upper","bound","for","numer","of","timesteps","per","episode","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","not","given",",","better","implicitly","specified","via","`","environment","`","argument","for","`","Agent.create","(","...",")","`",")",".","action_values","(","dict","[","value","]",")",":","Constant","value","per","action","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","false","for","binary","boolean","actions",",","0","for","discrete","integer","actions",",","0.0","for","continuous","actions",")",".","config","(","specification",")",":","Additional","configuration","options",":","<","ul",">","<","li",">","<","b",">","name","<","\/b",">","(","<","i",">","string","<","\/i",">",")","&","ndash",";","Agent","name",",","used","e.g",".","for","TensorFlow","scopes","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","``","agent","''",")",".","<","li",">","<","b",">","device","<","\/b",">","(","<","i",">","string","<","\/i",">",")","&","ndash",";","Device","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","TensorFlow","default",")",".","<","li",">","<","b",">","seed","<","\/b",">","(","<","i",">","int","<","\/i",">",")","&","ndash",";","Random","seed","to","set","for","Python",",","NumPy","(","both","set","globally","!",")","and","TensorFlow",",","environment","seed","may","have","to","be","set","separately","for","fully","deterministic","execution","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","none",")",".","<","\/li",">","<","li",">","<","b",">","buffer_observe","<","\/b",">","(","<","i",">","false","|","``","episode","''","|","int",">","0","<","\/i",">",")","&","ndash",";","Number","of","timesteps","within","an","episode","to","buffer","before","calling","the","internal","observe","function",",","to","reduce","calls","to","TensorFlow","for","improved","performance","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","configuration-specific","maximum","number","which","can","be","buffered","without","affecting","performance",")",".","<","\/li",">","<","li",">","<","b",">","always_apply_exploration","<","\/b",">","(","<","i",">","bool","<","\/i",">",")","&","ndash",";","Whether","to","always","apply","exploration",",","also","for","independent","`","act","(",")","`","calls","(","final","value","in","case","of","schedule",")","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","false",")",".","<","\/li",">","<","li",">","<","b",">","always_apply_variable_noise","<","\/b",">","(","<","i",">","bool","<","\/i",">",")","&","ndash",";","Whether","to","always","apply","variable","noise",",","also","for","independent","`","act","(",")","`","calls","(","final","value","in","case","of","schedule",")","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","false",")",".","<","\/li",">","<","li",">","<","b",">","enable_int_action_masking","<","\/b",">","(","<","i",">","bool","<","\/i",">",")","&","ndash",";","Whether","int","action","options","can","be","masked","via","an","optional","``","[","ACTION-NAME","]","_mask","''","state","input","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","true",")",".","<","\/li",">","<","li",">","<","b",">","create_tf_assertions","<","\/b",">","(","<","i",">","bool","<","\/i",">",")","&","ndash",";","Whether","to","create","internal","TensorFlow","assertion","operations","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","true",")",".","<","\/li",">","<","\/ul",">","recorder","(","path","|","specification",")",":","Traces","recordings","directory",",","or","recorder","configuration","with","the","following","attributes","(","see","[","record-and-pretrain","script","]","(","https",":","\/\/github.com\/tensorforce\/tensorforce\/blob\/master\/examples\/record_and_pretrain.py",")","for","example","application",")","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","no","recorder",")",":","<","ul",">","<","li",">","<","b",">","directory","<","\/b",">","(","<","i",">","path","<","\/i",">",")","&","ndash",";","recorder","directory","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","<","\/li",">","<","li",">","<","b",">","frequency","<","\/b",">","(","<","i",">","int",">","0","<","\/i",">",")","&","ndash",";","how","frequently","in","episodes","to","record","traces","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","every","episode",")",".","<","\/li",">","<","li",">","<","b",">","start","<","\/b",">","(","<","i",">","int",">","=","0","<","\/i",">",")","&","ndash",";","how","many","episodes","to","skip","before","starting","to","record","traces","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","0",")",".","<","\/li",">","<","li",">","<","b",">","max-traces","<","\/b",">","(","<","i",">","int",">","0","<","\/i",">",")","&","ndash",";","maximum","number","of","traces","to","keep","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","all",")",".","<","\/li",">"]
code: def __init__(
      # Environment
      self,
      states,
      actions,
      max_episode_timesteps=None,
      # Agent
      action_values=None,
      # Config, recorder
      config=None,
      recorder=None,
  ):
      if not hasattr(self, "spec"):
          self.spec = OrderedDict(
              agent="constant",
              states=states,
              actions=actions,
              max_episode_timesteps=max_episode_timesteps,
              action_values=action_values,
              config=config,
              recorder=recorder,
          )
  
      super().__init__(
          states=states,
          actions=actions,
          max_episode_timesteps=max_episode_timesteps,
          parallel_interactions=1,
          config=config,
          recorder=recorder,
      )
  
      self.model = ConstantModel(
          states=self.states_spec,
          actions=self.actions_spec,
          parallel_interactions=self.parallel_interactions,
          config=self.config,
          summarizer=None,
          tracking=None,
          action_values=action_values,
      )
  
imports: from collections import OrderedDict
  from tensorforce.agents import Agent
  from tensorforce.core.models import ConstantModel
label_desc: Use image node_id 1 to create a new ConstantAgent object from inherited base classes: Agent with example: obj = ConstantAgent(states, actions, max_episode_timesteps, action_values, config, recorder)