docstr: If there is an experiment set on this generation strategy as the
  experiment it has been generating generator runs for, check if the
  experiment passed in is the same as the one saved and log an information
  statement if its not. Set the new experiment on this generation strategy.
docstr_tok: ["If","there","is","an","experiment","set","on","this","generation","strategy","as","the","experiment","it","has","been","generating","generator","runs","for",",","check","if","the","experiment","passed","in","is","the","same","as","the","one","saved","and","log","an","information","statement","if","its","not",".","Set","the","new","experiment","on","this","generation","strategy","."]
code: def experiment(self, experiment: Experiment) -> None:
      """If there is an experiment set on this generation strategy as the
      experiment it has been generating generator runs for, check if the
      experiment passed in is the same as the one saved and log an information
      statement if its not. Set the new experiment on this generation strategy.
      """
      if (
          self._experiment is None
          or experiment._name == self.experiment._name
      ):
          self._experiment = experiment
      else:
          raise ValueError(
              "This generation strategy has been used for experiment "
              f"{self.experiment._name} so far; cannot reset experiment"
              f" to {experiment._name}. If this is a new optimization, "
              "a new generation strategy should be created instead."
          )
  
file_path: Ax/ax/core/generation_strategy_interface.py
imports: from abc import ABC, abstractmethod
  from typing import List, Optional
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun
  from ax.utils.common.base import Base
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 5 for calling the GenerationStrategyInterface obj's underlying member method code with example usage: obj.experiment(experiment) without return types