class_docstr: Unit-test base class.
class_docstr_tok: ["Unit-test","base","class","."]
code: def execute(
      self,
      agent,
      environment,
      num_episodes=None,
      experience_update=None,
  ):
      if num_episodes is None:
          num_updates = 2
      else:
          num_updates = None
  
      runner = Runner(agent=agent, environment=environment)
      runner.run(
          num_episodes=num_episodes,
          num_updates=num_updates,
          use_tqdm=False,
      )
      runner.close()
  
      # Test experience-update, independent, deterministic
      if experience_update or (
          experience_update is None and self.__class__.experience_update
      ):
          for episode in range(
              2 if num_episodes is None else num_episodes
          ):
              episode_states = list()
              episode_internals = list()
              episode_actions = list()
              episode_terminal = list()
              episode_reward = list()
              states = environment.reset()
              internals = agent.initial_internals()
              terminal = False
              deterministic = True
              while not terminal:
                  episode_states.append(states)
                  episode_internals.append(internals)
                  actions, internals = agent.act(
                      states=states,
                      internals=internals,
                      independent=True,
                      deterministic=deterministic,
                  )
                  deterministic = not deterministic
                  episode_actions.append(actions)
                  states, terminal, reward = environment.execute(
                      actions=actions
                  )
                  episode_terminal.append(terminal)
                  episode_reward.append(reward)
              agent.experience(
                  states=episode_states,
                  internals=episode_internals,
                  actions=episode_actions,
                  terminal=episode_terminal,
                  reward=episode_reward,
              )
              agent.update()
  
      self.finished_test()
  
file_path: tensorforce/test/unittest_base.py
imports: from copy import deepcopy
  from datetime import datetime
  import sys
  from tensorforce import Agent, Environment, Runner
  from test.unittest_environment import UnittestEnvironment
label_desc: Use image node_id 6 for calling the UnittestBase obj's underlying member method code with example usage: obj.execute(agent, environment, num_episodes, experience_update) without return types