跳转至

BaseConfig(配置基类)

evotoolkit.core.BaseConfig

Base configuration class for evolutionary methods.

Note: task is accessed via interface.task to avoid data redundancy.

Source code in src/evotoolkit/core/base_config.py
class BaseConfig:
    """
    Base configuration class for evolutionary methods.

    Note: task is accessed via interface.task to avoid data redundancy.
    """

    def __init__(self, interface: "BaseMethodInterface", output_path: str, verbose: bool = True):
        self.interface = interface
        self.output_path = output_path
        self.verbose = verbose

    @property
    def task(self) -> "BaseTask":
        """Access task through interface to avoid redundancy."""
        return self.interface.task

task property

task: BaseTask

Access task through interface to avoid redundancy.


常见参数:

  • interfaceBaseMethodInterface):任务接口
  • output_pathstr):结果保存路径
  • running_llmHttpsApi):LLM 客户端
  • max_generationsint):最大代数
  • pop_sizeint):种群大小