### Install IOHExperimenter Source: https://iohprofiler.github.io/IOHexperimenter/python.html Install the IOHExperimenter library using pip. Ensure you are using version 0.3.10 or later. ```bash pip install ioh>=0.3.10 ``` -------------------------------- ### Example Usage Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_eaf.html Demonstrates how to use the Levels class to compute and retrieve attainment levels. ```APIDOC ## Example ```cpp // Assuming 'suite' is a configured optimization suite and 'logger' is an EAF logger attached to it. // For example: // suite::BBOB suite({1, 2}, {1, 2}, {10, 30}); // logger::EAF logger; // suite.attach_logger(logger); // ... [run optimization problems] size_t nb_runs = logger.get_num_runs(); // Get the total number of runs // Create a Levels object to compute specific levelsets (e.g., first, middle, and last) logger::eaf::stat::Levels levels_at(common::OptimizationType::MIN, {0, nb_runs / 2, nb_runs - 1}); // Actually compute the levels using the logger data auto levels = levels_at(logger); // 'levels' now contains the computed attainment levelsets. ``` ``` -------------------------------- ### Run IOHExperimenter Server with Default Configuration Source: https://iohprofiler.github.io/IOHexperimenter/server.html Start the `ioh-server` executable, specifying the query and reply FIFO paths. ```bash ./server/ioh-server query reply ``` -------------------------------- ### Clone and Build IOHExperimenter Source: https://iohprofiler.github.io/IOHexperimenter/cpp.html Commands to download, compile, and install the IOHExperimenter C++ package using Git and CMake. Customize installation path with CMAKE_INSTALL_PREFIX. ```bash git clone --recursive https://github.com/IOHProfiler/IOHexperimenter.git cd IOHexperimenter mkdir build cd build cmake .. && make install ``` -------------------------------- ### Verify IOHExperimenter Installation Source: https://iohprofiler.github.io/IOHexperimenter/python.html Verify the installation of the IOHExperimenter library by checking its installed version. ```bash pip show ioh ``` -------------------------------- ### Instantiate Optimization Problems in C++ Source: https://iohprofiler.github.io/IOHexperimenter/cpp.html Examples of creating problem instances for PBO (OneMax) and BBOB (Sphere) using their respective classes. The instance ID serves as a random seed for problem transformations. ```cpp #include "ioh.hpp" auto om = ioh::problem::pbo::OneMax(1, 10); // PBO problem: instance 1, dim 10 auto sp = ioh::problem::bbob::Sphere(1, 5); // BBOB problem: instance 1, dim 5 ``` -------------------------------- ### EAH Logger Usage Example Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html An example demonstrating how to use the EAH logger with a BBOB suite. ```APIDOC ## EAH Logger Usage Example ### Description This example shows how to initialize an EAH logger, attach it to a problem suite, and log evaluations during problem solving. ### Code Example ```cpp using namespace ioh::problem; using namespace ioh::logger; unsigned int sample_size = 100; unsigned int buckets = 20; ioh::suite::BBOB suite({1, 2}, {1, 2}, {2, 10}); ioh::logger::EAH logger(0, 6e7, buckets, 0, sample_size, buckets); suite.attach_logger(logger); for (const auto &p : suite) { for (auto r = 0; r < 2; r++) { // Assuming 2 runs for (auto s = 0; s < sample_size; ++s) { // Logging sample_size evaluations (*p)(ioh::common::random::real(p->meta_data().n_variables)); } p->reset(); // Reset for the next run } } ``` ``` -------------------------------- ### Experiment Class Source: https://iohprofiler.github.io/IOHexperimenter/python/ioh.html Class to help easily setup benchmarking experiments. ```APIDOC ## Experiment ### Description Class to help easily setup benchmarking experiments. ### Parameters - **algorithm**: The algorithm to use for the experiment. - **fids**: A list of function IDs to include in the experiment. - **iids**: A list of instance IDs to include in the experiment. - **dims**: A list of dimensions to include in the experiment. - **...**: Additional keyword arguments. ``` -------------------------------- ### Combine Loggers Example Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html Demonstrates how to combine multiple loggers (e.g., ecdf_logger and csv_logger) into a single logger object using LoggerCombine. This allows for simultaneous logging to different destinations or formats. ```cpp FIXME update this example BBOB_suite bench({1},{2},{3}); using Input = BBOB_suite::Input_type; ecdf_logger log_ecdf(0,6e7,20, 0,100,20); csv_logger log_csv; // Combine them all LoggerCombine loggers(log_ecdf); loggers.add(log_csv); // Now you can single call. loggers.track_suite(bench); // etc. ``` -------------------------------- ### Initialize Experiment with Tracked Parameters Source: https://iohprofiler.github.io/IOHexperimenter/python.html Use the Experiment class to set up benchmarking with multiple functions. Specify the algorithm, problem details, and a list of attributes to be logged from the algorithm instance. ```python from ioh import Experiment ``` ```python exp = Experiment( RandomSearch(10), # instance of optimization algorithm [1], # list of problem id's [1, 2], # list of problem instances [5], # list of problem dimensions problem_class = ProblemClass.BBOB, # the problem type, function ids should correspond to problems of this type njobs = 1, # the number of parrellel jobs for running this experiment reps = 2, # the number of repetitions for each (id x instance x dim) logged_attributes = [ # list of the tracked variables, must be available on the algorithm instance (RandomSearch) "a_property", "a_tracked_parameter" ] ) ``` -------------------------------- ### Creating a Problem Instance (create) Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.IntegerSingleObjective.html Illustrates the static method `create` for instantiating an IntegerSingleObjective problem, showing both signature variations. ```APIDOC ## Method create (static) ### Description Creates an instance of an IntegerSingleObjective problem. ### Parameters #### Overload 1: - **problem_name** (_str_): A string indicating the name of the problem. - **instance_id** (_int_): An integer identifier for the problem instance, used for seeding random transformations. - **dimension** (_int_): The dimensionality of the search space. #### Overload 2: - **problem_id** (_int_): The index of the problem to create. - **instance_id** (_int_): An integer identifier for the problem instance, used for seeding random transformations. - **dimension** (_int_): The dimensionality of the search space. ### Example ```python # Using problem name problem_instance_1 = IntegerSingleObjective.create("MyProblem", 1, 10) # Using problem ID problem_instance_2 = IntegerSingleObjective.create(5, 2, 20) ``` ``` -------------------------------- ### Get Help on IOH Problems Source: https://iohprofiler.github.io/IOHexperimenter/python.html Access the docstrings for the problem module to get detailed information about available problems and their usage. ```python help(problem) ``` -------------------------------- ### ioh::logger::EAH::init_eah Source: https://iohprofiler.github.io/IOHexperimenter/genindex.html Initializes EAH. ```APIDOC ## ioh::logger::EAH::init_eah ### Description Initializes EAH. ### Signature ```cpp ioh::logger::EAH::init_eah ``` ``` -------------------------------- ### Log Algorithm Parameters with Analyzer Source: https://iohprofiler.github.io/IOHexperimenter/python.html Instantiate the Analyzer, then track static and dynamic parameters of an algorithm instance. Attach a problem to the logger and run the algorithm. ```python algorithm = RandomSearch(10) l3 = logger.Analyzer(folder_name="temp3") # Track variables static over the course of an algorithm run l3.add_run_attributes(algorithm, ["algorithm_id"]) # Track dynamic variables, updated during the run of an algorithm l3.watch(algorithm, ["a_property", "a_tracked_parameter"]) # attach a problem to the logger p2 = get_problem(2, 2, 5) p2.attach_logger(l3) for run in range(10): algorithm(p2) # run the algorithm on the problem p2.reset() # reset the problem and logger state algorithm.reset() # update the algorithm_id parameter ``` -------------------------------- ### get_static_root Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_common_file_utils.html Get the absolute path of the IOHexperimenter/static directory. ```APIDOC ## get_static_root ### Description Get the absolute path of the IOHexperimenter/static directory. ### Returns - fs::path - The absolute path of IOHexperimenter/static. ``` -------------------------------- ### CurrentY.__call__() Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.logger.property.CURRENTY.html This method is called to get the current Y value. ```APIDOC ## CurrentY.__call__() ### Description Returns the current Y value. ### Method Signature `__call__(_self : ioh.iohcpp.logger.property.AbstractProperty_, _arg0 : ioh.iohcpp.LogInfo_) → float | None` ``` -------------------------------- ### Sphere Problem Initialization Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.Sphere.html Demonstrates how to create an instance of the Sphere problem. ```APIDOC ## create ### Description Overloaded function to create a problem instance. ### Method `static create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB` `static create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB` ### Parameters #### create(problem_name: str, instance_id: int, dimension: int) - **problem_name** (str) - A string indicating the problem name. - **instance_id** (int) - An integer identifier of the problem instance. - **dimension** (int) - The dimensionality of the search space. #### create(problem_id: int, instance_id: int, dimension: int) - **problem_id** (int) - An integer identifier of the problem. - **instance_id** (int) - An integer identifier of the problem instance. - **dimension** (int) - The dimensionality of the search space. ``` -------------------------------- ### ioh::watch::address Source: https://iohprofiler.github.io/IOHexperimenter/genindex.html Gets the address of a variable. This is a C++ function. ```APIDOC ## ioh::watch::address ### Description Gets the address of a variable. This is a C++ function. ### Usage ```cpp auto addr = ioh::watch::address(variable); ``` ``` -------------------------------- ### ioh::logger::EAH::size Source: https://iohprofiler.github.io/IOHexperimenter/genindex.html Gets the size related to EAH. ```APIDOC ## ioh::logger::EAH::size ### Description Returns the size associated with the EAH context. ### Signature ```cpp ioh::logger::EAH::size() ``` ``` -------------------------------- ### Display Experiment Help Source: https://iohprofiler.github.io/IOHexperimenter/python.html View the help documentation for the Experiment class to understand its parameters and usage. ```python help(Experiment) ``` -------------------------------- ### independent_runs() const Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh.html Gets the current number of independent runs configured for the experiment. ```APIDOC ## independent_runs() const ### Description Get’s the number of independent runs to be used in run. ### Returns int - The number of independent runs ``` -------------------------------- ### Instantiate FlatFile Logger Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html Create a FlatFile logger instance. Specify triggers, properties to watch, the output filename, and the output directory. The logger can be configured with custom separators, comment characters, and no-value strings. ```cpp logger::FlatFile( {trigger::always}, {watch::evaluations, watch::transformed_y}, "my_experiment.dat", "./today/" ); ``` -------------------------------- ### get_static_root_by_env Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_common_file_utils.html Get the absolute path of the IOHexperimenter/static directory using environment variables. ```APIDOC ## get_static_root_by_env ### Description Get the absolute path of the IOHexperimenter/static directory. This function attempts to find the absolute path based on environment variables. It first checks if ‘IOH_RESOURCES’ is set and uses it if available. If ‘IOH_RESOURCES’ is not set, it then checks ‘GITHUB_WORKSPACE’. If neither are set, it logs an error and returns a placeholder path. ### Returns - fs::path - The absolute path of IOHexperimenter/static. ``` -------------------------------- ### LunacekBiRastrigin.create() Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.LunacekBiRastrigin.html Static method to create an instance of the LunacekBiRastrigin problem. ```APIDOC ## Static Method: LunacekBiRastrigin.create ### Description Creates an instance of the LunacekBiRastrigin problem. This is an overloaded function that can accept either a problem name or a problem ID. ### Overloads 1. **create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB** - **problem_name**: The name of the problem. - **instance_id**: An integer identifier for the problem instance. - **dimension**: The dimensionality of the search space. 2. **create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB** - **problem_id**: The ID of the problem. - **instance_id**: An integer identifier for the problem instance. - **dimension**: The dimensionality of the search space. ``` -------------------------------- ### CEC2022Rosenbrock Instantiation and Usage Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.CEC2022Rosenbrock.html Demonstrates how to create and use an instance of the CEC2022Rosenbrock problem. ```APIDOC ## Class: CEC2022Rosenbrock ### Description Represents the CEC2022 Rosenbrock problem, a benchmark function used in optimization. ### Methods #### `__init__` ```python CEC2022Rosenbrock(_self: ioh.iohcpp.problem.CEC2022Rosenbrock, _instance: int, _n_variables: int) ``` Initializes a new instance of the CEC2022Rosenbrock problem. #### `__call__` ```python __call__(x: list) -> float __call__(x: list[list]) -> list[float] ``` Evaluates the problem at the given search point(s). Parameters: - **x** (list): A 1D or 2D list representing the search point(s). Returns: - float: The objective value for a single search point. - list[float]: A list of objective values for multiple search points. #### `create` ```python @staticmethod create(*args, **kwargs) ``` Overloaded function to create a problem instance. Can be called with either problem name or ID. Example 1: ```python create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.CEC2022 ``` Example 2: ```python create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.CEC2022 ``` #### `reset` ```python reset() ``` Resets all state variables of the problem. ### Attributes - **bounds**: The bounds of the problem. - **constraints**: The constraints of the problem. - **log_info**: The data being sent to the logger. - **meta_data**: Static meta-data of the problem (e.g., problem ID, instance ID, dimensionality). - **optimum**: The optimum and its objective value for a problem instance. - **state**: The current state of the optimization process (e.g., current solution, number of function evaluations). ``` -------------------------------- ### IdGetter Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_common.html Helper to get a new ID for a non-problem class. It retrieves an ID. ```APIDOC template static inline FactoryID get_id(const std::vector &ids) ``` -------------------------------- ### CEC2022SchafferF7 Methods Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.CEC2022SchafferF7.html This section outlines the core methods available for the CEC2022SchafferF7 problem. These methods allow for initialization and configuration of the problem instance. ```APIDOC ## CEC2022SchafferF7 Class ### Description Provides an interface for the CEC2022SchafferF7 benchmark problem. ### Methods #### `reset()` Resets the problem to its initial state. #### `set_id(int id)` Sets the unique identifier for the problem instance. - **id** (int) - The identifier for the problem. #### `set_instance(int instance)` Sets the specific instance of the problem. - **instance** (int) - The instance number. #### `set_name(std::string name)` Sets the name of the problem. - **name** (std::string) - The name of the problem. ``` -------------------------------- ### Get ManyAffine Instances Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_problem_bbob.html Retrieves the instance IDs for the 24 sub-problems within the ManyAffine problem. ```cpp inline std::array get_instances()# ``` -------------------------------- ### BuecheRastrigin.create() Static Method Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.BuecheRastrigin.html Factory method to create instances of BBOB problems, including BuecheRastrigin. ```APIDOC ## BuecheRastrigin.create() ### Description Overloaded function to create a problem instance. ### Overloads 1. **create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB** - **problem_name**: The name of the problem. - **instance_id**: An integer identifier of the problem instance. - **dimension**: The dimensionality of the search space. 2. **create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB** - **problem_id**: The ID of the problem. - **instance_id**: An integer identifier of the problem instance. - **dimension**: The dimensionality of the search space. ``` -------------------------------- ### BBOB Suite Attributes Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.suite.BBOB.html Access attributes of the BBOB suite to get information about the contained problems. ```APIDOC ## BBOB Suite Attributes ### Description These attributes provide information about the problems included in the BBOB suite. ### Attributes - **`dimensions`** (List[int]): The list of all dimensions configured for the problems in the current suite. - **`instances`** (List[int]): The list of all instance IDs configured for the problems in the current suite. - **`name`** (str): The name of the suite (e.g., 'BBOB'). - **`problem_ids`** (List[int]): The list of all problem IDs included in the current suite. ### Example ```python from ioh.iohcpp.suite import BBOB bbob_suite = BBOB(problem_ids=[1, 2], instances=[1], dimensions=[5]) print(f"Suite Name: {bbob_suite.name}") print(f"Problem IDs: {bbob_suite.problem_ids}") print(f"Instances: {bbob_suite.instances}") print(f"Dimensions: {bbob_suite.dimensions}") ``` ``` -------------------------------- ### Experiment Initialization Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.Experiment.html Initializes an Experiment object to set up a benchmarking experiment. It requires an algorithm instance and specifies the problems, instances, and dimensions to evaluate. ```APIDOC ## Experiment Constructor ### Description Initializes an Experiment object to set up a benchmarking experiment. It requires an algorithm instance and specifies the problems, instances, and dimensions to evaluate. ### Parameters * **algorithm** (_Any_) – A instance of a given algorithm. Must implement a __call__ method taking a ioh.problem as argument. * **fids** (_List_[_int_]_) – A list of integer problem ids to evaluate * **iids** (_List_[_int_]_,) – A list of integer problem instances to evaluate * **dims** (_List_[_int_]_,) – A list of integer problem dimensions to evaluate * **reps** (_int = 1_,) – The number of independent repetitions for each problem, instance dimension combination * **problem_class** (_ProblemClass = ProblemClass.REAL_,) – The type of problems to test. * **njobs** (_int = 1_) – The number of parallel jobs, -1 assigns all available cpu’s, * **logged** (_bool = True_) – Whether or not the experiment uses a logger * **logger_triggers** (_List_[_logger.trigger.Trigger_ _]_) – A list of trigger instances, used to determine when to trigger * **logger_additional_properties** (_List_[_logger.property.AbstractProperty_ _]_) – A list of additional properties to be logged. * **output_directory** (_str = "./"_) – The root output directory for the logger * **folder_name** (_str = "ioh_data"_) – The name of the output directory for the logger * **algorithm_name** (_str = None_) – A name for the algorithm. This is used in the log files. * **algorithm_info** (_str = ""_) – Optional information, additional information used in log files * **optimization_type** (_OptimizationType = OptimizationType.MIN_) – The type of optimization * **store_positions** (_bool = False_) – Whether to store the x-positions in the data-files * **experiment_attributes** (_Dict_[_str_,_str_]_=__[__]_) – Attributes additionally stored per experiment. * **run_attributes** (_List_[_str_]_=__[__]_) – Names of attributes which are updated at every run, i.e. run index. * **logged_attributes** (_List_[_str_]_=__[__]_) – Names of attributes which are updated during the run of the algoritm, and are logged in the data files at every time point there is a logging action. * **merge_output** (_bool = True_) – Whether to merge output from multiple folders with the same folder_name. * **zip_output** (_bool = True_) – Whether to produce a .zip folder of output * **remove_data** (_bool = False_) – Whether to remove all the produced data, except for the .zip file (when produced). ``` -------------------------------- ### Get ManyAffine Scale Factors Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_problem_bbob.html Retrieves the scale factors applied to each of the 24 sub-problems in the ManyAffine problem. ```cpp inline std::array get_scale_factors()# ``` -------------------------------- ### BBOB Suite Source: https://iohprofiler.github.io/IOHexperimenter/python/suite.html Initializes a Suite with BBOB functions included in IOH. ```APIDOC ## BBOB ### Description Suite with BBOB functions included in IOH. ### Parameters - **problem_ids** (list) - Required - A list of problem IDs to include in the suite. - **instances** (list, optional) - A list of instance IDs to use for the problems. - **dimensions** (list, optional) - A list of dimensions to use for the problems. ``` -------------------------------- ### IdGetter Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_common.html Helper to get a new ID for a problem class. It retrieves an ID from the class meta_data. ```APIDOC template static inline FactoryID get_id(const std::vector&) ``` -------------------------------- ### PBO Suite Source: https://iohprofiler.github.io/IOHexperimenter/python/suite.html Initializes a Suite with PBO functions included in IOH. ```APIDOC ## PBO ### Description Suite with PBO functions included in IOH. ### Parameters - **problem_ids** (list) - Required - A list of problem IDs to include in the suite. - **instances** (list, optional) - A list of instance IDs to use for the problems. - **dimensions** (list, optional) - A list of dimensions to use for the problems. ``` -------------------------------- ### TransformedY.__call__() Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.logger.property.TRANSFORMEDY.html This method is called to get the TransformedY value. It takes LogInfo as an argument and returns a float or None. ```APIDOC ## TransformedY.__call__() ### Description Returns the TransformedY value. ### Parameters - `_self` (ioh.iohcpp.logger.property.AbstractProperty_): The instance of the property. - `_arg0` (ioh.iohcpp.LogInfo_): Log information object. ### Returns - `float | None`: The TransformedY value or None if not available. ``` -------------------------------- ### Run IOHExperimenter Server with Specific Problem Source: https://iohprofiler.github.io/IOHexperimenter/server.html Configure the server to serve a specific problem by setting type, problem name, instance, and dimension. ```bash ioh-server -t real -p Rosenbrock -i 1 -d 10 query reply ``` -------------------------------- ### attach_problem Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html Starts a new session for the given problem/instance/dimension/run. This is called automatically by the Problem or Suite to which the Logger is attached. ```APIDOC ## attach_problem ### Description Starts a new session for the given problem/instance/dimension/run. This is called automatically by the Problem or Suite to which the Logger is attached, each time a change occurs (be it a new run, or a new problem instance). ### Warning If you override this function, do not forget to call the base class one. ``` -------------------------------- ### BBOB Suite Initialization Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.suite.BBOB.html Initialize the BBOB suite by specifying problem IDs, instances, and dimensions. ```APIDOC ## BBOB Suite Initialization ### Description Instantiate the BBOB suite by providing a list of problem IDs, a list of instance IDs, and a list of dimensions. ### Parameters #### `problem_ids` (List[int]) - Required A list of problem IDs to include in the suite. #### `instances` (List[int]) - Optional, Default: [1] A list of instance IDs to include in the suite. #### `dimensions` (List[int]) - Optional, Default: [5] A list of dimensions to include in the suite. ### Example ```python from ioh.iohcpp.suite import BBOB # Initialize with specific problem IDs, instances, and dimensions bbob_suite = BBOB(problem_ids=[1, 2, 3], instances=[1, 2], dimensions=[10, 20]) # Initialize with default instances and dimensions bbob_suite_default = BBOB(problem_ids=[1, 2, 3]) ``` ``` -------------------------------- ### Get ManyAffine Function Values Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_problem_bbob.html Retrieves the objective function values for each of the 24 sub-problems within the ManyAffine problem. ```cpp inline std::array get_function_values()# ``` -------------------------------- ### Real Suite Source: https://iohprofiler.github.io/IOHexperimenter/python/suite.html Initializes a Suite with Real functions included in IOH. ```APIDOC ## Real ### Description Suite with Real functions included in IOH. ### Parameters - **problem_ids** (list) - Required - A list of problem IDs to include in the suite. - **instances** (list, optional) - A list of instance IDs to use for the problems. - **dimensions** (list, optional) - A list of dimensions to use for the problems. ``` -------------------------------- ### IdGetter Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_common.html A helper struct to get a new ID for a given class, templated on whether it's a problem class. ```APIDOC ## Struct IdGetter ### Description Helper struct to obtain a new ID for a given class. Templated to differentiate between problem-related IDs and others. ### Template Parameters - **IsProblem** (bool): A boolean flag indicating if this ID getter is for a problem class. ``` -------------------------------- ### Initialize Analyzer Logger Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger_analyzer_v1.html Instantiate the Analyzer logger with specific triggers, properties, and storage details. This sets up the logging mechanism for an experiment. ```cpp logger::Analyzer( {trigger::always}, {watch::evaluations, watch::transformed_y}, "~/data", "experiment_folder", "MyOptimizer", "Version 1.0" ); ``` -------------------------------- ### Initialize and Use EAH Logger with BBOB Suite Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html This snippet demonstrates how to initialize the EAH logger with specified sample size and buckets, attach it to the BBOB suite, and then iterate through the suite to log evaluations. Ensure the logger and suite are correctly configured before use. ```cpp using namespace ioh::problem; using namespace ioh::logger; unsigned int sample_size = 100; unsigned int buckets = 20; ioh::suite::BBOB suite({1, 2}, {1, 2}, {2, 10}); ioh::logger::EAH logger(0, 6e7, buckets, 0, sample_size, buckets); suite.attach_logger(logger); for (const auto &p : suite) { for (auto r = 0; r < 2; r++) { for (auto s = 0; s < sample_size; ++s) { (*p)(ioh::common::random::real(p->meta_data().n_variables)); } // s in sample_size p->reset(); // New run } // r in runs } // p in suite ``` -------------------------------- ### MaxInfluence.reset() Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.MaxInfluence.html Resets the MaxInfluence instance to its initial state. This is useful for starting a new calculation or clearing previous results. ```APIDOC ## MaxInfluence.reset() ### Description Resets the MaxInfluence instance to its initial state. ### Method `reset()` ### Parameters None ### Response None ``` -------------------------------- ### Ellipsoid Problem Initialization Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.Ellipsoid.html Demonstrates how to create an instance of the Ellipsoid problem using its static create method. ```APIDOC ## create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB ### Description Create a problem instance. ### Parameters * **problem_name** (str) - A string indicating the problem name. * **instance_id** (int) - An integer identifier of the problem instance. * **dimension** (int) - The dimensionality of the search space. ## create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB ### Description Create a problem instance. ### Parameters * **problem_id** (int) - A string indicating the problem name. * **instance_id** (int) - An integer identifier of the problem instance. * **dimension** (int) - The dimensionality of the search space. ``` -------------------------------- ### Get Help on IOH Logger Analyzer Source: https://iohprofiler.github.io/IOHexperimenter/python.html Access the docstrings for the logger.Analyzer class to understand its parameters and usage for data logging. ```python help(logger.Analyzer) ``` -------------------------------- ### Example JSON Value Reply Message Source: https://iohprofiler.github.io/IOHexperimenter/server.html A JSON object representing a 'value' reply, containing the evaluated objective function value. ```json { "reply_type": "value", "value": 21 } ``` -------------------------------- ### GriewankRosenbrock Constructor Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.GriewankRosenbrock.html Initializes a GriewankRosenbrock problem instance. ```APIDOC ## Constructor: GriewankRosenbrock(instance: int, n_variables: int) ### Parameters - `instance` (int): The instance ID of the problem. - `n_variables` (int): The dimensionality of the search space. ``` -------------------------------- ### Example JSON Call Query Message Source: https://iohprofiler.github.io/IOHexperimenter/server.html A JSON object representing a 'call' query, containing the solution to be evaluated by the objective function. ```json { "query_type":"call", "solution": [10,10] } ``` -------------------------------- ### LABS Problem Initialization and Usage Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.LABS.html Demonstrates how to initialize and use the LABS problem, including evaluation and logger attachment. ```APIDOC ## LABS Class ### Description Represents the Low Autocorrelation Binary Sequences (LABS) problem. ### Methods #### `__call__(self, x: list) -> float` Evaluate the problem at a given search point. - **x** (list) - The search point to evaluate. Must be a 1-dimensional array/list matching the search space's dimensionality. #### `__call__(self, x: list[list]) -> list[float]` Evaluate the problem at multiple search points. - **x** (list[list]) - A list of search points to evaluate. Each point must be a 1-dimensional array/list matching the search space's dimensionality. #### `attach_logger(self, logger)` Attach a logger to the problem for performance tracking. - **logger** (Logger) - A logger-object from the IOHexperimenter logger module. #### `create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` Create a problem instance using the problem name. - **problem_name** (str) - A string indicating the problem name. - **instance_id** (int) - An integer identifier of the problem instance. - **dimension** (int) - The dimensionality of the search space. #### `create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` Create a problem instance using the problem ID. - **problem_id** (int) - An integer identifier for the problem. - **instance_id** (int) - An integer identifier of the problem instance. - **dimension** (int) - The dimensionality of the search space. #### `reset(self)` Reset all state variables of the problem. #### `set_id(self, problem_id: int)` Update the problem ID. - **problem_id** (int) - The new problem ID. #### `set_instance(self, instance_id: int)` Update the problem instance ID. - **instance_id** (int) - The new instance ID. #### `set_name(self, problem_name: str)` Update the problem name. - **problem_name** (str) - The new problem name. ### Attributes - **bounds**: The bounds of the problem. - **constraints**: The constraints of the problem. - **log_info**: The data being sent to the logger. - **meta_data**: Static meta-data of the problem (e.g., problem ID, instance ID, dimensionality). - **optimum**: The optimum and its objective value for a problem instance. - **problems**: Placeholder attribute. - **state**: The current state of the optimization process (e.g., current solution, function evaluations). ``` -------------------------------- ### Get ManyAffine Constituent Problems Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_problem_bbob.html Retrieves a collection of shared pointers to the 24 individual BBOB problems that constitute the ManyAffine problem. ```cpp inline std::array, 24> get_problems()# ``` -------------------------------- ### create Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.LeadingOnesRuggedness2.html Factory method to create instances of PBO problems, including LeadingOnesRuggedness2. ```APIDOC ## Static Method create ### Description Overloaded function to create a problem instance. ### Usage 1. `create(problem_name: str, instance_id: int, dimension: int) -> PBO` - `problem_name`: The name of the problem. - `instance_id`: The identifier of the problem instance. - `dimension`: The dimensionality of the search space. 2. `create(problem_id: int, instance_id: int, dimension: int) -> PBO` - `problem_id`: The ID of the problem. - `instance_id`: The identifier of the problem instance. - `dimension`: The dimensionality of the search space. ``` -------------------------------- ### ioh::problem::pbo::LeadingOnesDummy2 Source: https://iohprofiler.github.io/IOHexperimenter/genindex.html Another dummy implementation for the LeadingOnes problem. ```APIDOC ## ioh::problem::pbo::LeadingOnesDummy2::evaluate ### Description Evaluates the second dummy LeadingOnes problem. ### Signature `evaluate(solution: List[int]) -> float` ## ioh::problem::pbo::LeadingOnesDummy2::info_ ### Description Returns information about the second dummy LeadingOnes problem. ### Signature `info_() -> str` ## ioh::problem::pbo::LeadingOnesDummy2::LeadingOnesDummy2 ### Description Constructor for the second dummy LeadingOnes problem. ### Signature `LeadingOnesDummy2()` ``` -------------------------------- ### FileSystemItem Path Manipulation Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_common_file.html Provides methods to set and get the full path of a file system item, as well as join paths. ```cpp inline void path(const fs::path &path)# ``` ```cpp inline fs::path path() const# ``` ```cpp inline fs::path operator/(const std::string &p) const# ``` ```cpp inline fs::path operator/(const fs::path &p) const# ``` -------------------------------- ### Send Data to TCP Port Source: https://iohprofiler.github.io/IOHexperimenter/server.html Send data to a TCP port that is being listened on by socat. This can be used to test the network gateway setup. ```bash echo "Hello World!" > /dev/tcp/127.0.0.1/8423 ``` -------------------------------- ### GriewankRosenbrock.create() Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.GriewankRosenbrock.html Factory method to create instances of GriewankRosenbrock or other BBOB problems. ```APIDOC ## Static Method: GriewankRosenbrock.create() ### Description Overloaded function to create a problem instance. ### Overload 1 `create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB` ### Parameters (Overload 1) - `problem_name` (str): The name of the problem. - `instance_id` (int): The identifier of the problem instance. - `dimension` (int): The dimensionality of the search space. ### Overload 2 `create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.BBOB` ### Parameters (Overload 2) - `problem_id` (int): The ID of the problem. - `instance_id` (int): The identifier of the problem instance. - `dimension` (int): The dimensionality of the search space. ``` -------------------------------- ### handle_new_problem Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger_analyzer_v2.html Protected virtual method called when a new problem is attached to the analyzer. It is part of the interface for handling changes in the experimental setup. ```APIDOC ## Analyzer::handle_new_problem(const problem::MetaData &problem) override ### Description Gets called when a new problem is attached. ``` -------------------------------- ### Get Current Attainment Matrix Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html Returns a reference to the current attainment matrix being worked on. This allows direct manipulation or inspection of the matrix for the active problem/instance/dimension. ```cpp inline eah::AttainmentMatrix ¤t_eah()# ``` -------------------------------- ### PBO Class Initialization Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.suite.PBO.html Initializes the PBO suite with specified problem IDs, instances, and dimensions. ```APIDOC ## PBO ### Description Suite with PBO functions included in IOH. This class is an iterator for problems, you can define a set of problems to iterate over. ### Parameters * **problem_ids** (list[int]) – A list of problems ids to include in this instantiation of the suite * **instances** (list[int], optional) – A list of problem instances to include in this instantiation of the suite. Defaults to [1]. * **dimensions** (list[int], optional) – A list of problem dimensions to include in this instantiation of the suite. Defaults to [16]. ``` -------------------------------- ### Get ManyAffine Weights Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_problem_bbob.html Retrieves the weight vector used by the ManyAffine problem. This vector defines the contribution of each of the 24 sub-problems to the final objective value. ```cpp inline std::array get_weights()# ``` -------------------------------- ### create Method Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.LeadingOnesDummy2.html Factory method to create an instance of the LeadingOnesDummy2 problem. ```APIDOC ## Method: create ### Description Overloaded function to create a problem instance. ### Overloads 1. `create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` - `problem_name` (str): A string indicating the problem name. - `instance_id` (int): An integer identifier of the problem instance. - `dimension` (int): The dimensionality of the search space. 2. `create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` - `problem_id` (int): An integer identifier of the problem instance (should be a string for problem name). - `instance_id` (int): An integer identifier of the problem instance. - `dimension` (int): The dimensionality of the search space. ``` -------------------------------- ### create Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.LeadingOnesRuggedness1.html Factory method to create an instance of the LeadingOnesRuggedness1 problem. ```APIDOC ## create ### Description Overloaded function to create a problem instance. ### Overloads 1. **create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO** Creates a problem instance using the problem name. - **problem_name** (str): The name of the problem. - **instance_id** (int): The integer identifier of the problem instance. - **dimension** (int): The dimensionality of the search space. 2. **create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO** Creates a problem instance using the problem ID. - **problem_id** (int): The integer identifier of the problem. - **instance_id** (int): The integer identifier of the problem instance. - **dimension** (int): The dimensionality of the search space. ``` -------------------------------- ### Get Evaluation Range Scale Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html Provides access to the scale object used for the evaluation targets in this logger instance. This allows inspection or modification of the evaluation discretization range. ```cpp inline eah::Scale &eval_range() const# ``` -------------------------------- ### Get Error Range Scale Source: https://iohprofiler.github.io/IOHexperimenter/cpp/ioh_logger.html Provides access to the scale object used for the error targets in this logger instance. This allows inspection or modification of the error discretization range. ```cpp inline eah::Scale &error_range() const# ``` -------------------------------- ### PBO Class Static Methods Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.PBO.html Details on how to create PBO problem instances using the static `create` method, which supports creation via problem name or ID. ```APIDOC ## `create(*args, **kwargs)` Overloaded function to create a problem instance. **Overload 1:** `create(problem_name: str, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` Creates a problem instance using the problem name. **Parameters:** * **problem_name** (str) – The name of the problem. * **instance_id** (int) – The identifier of the problem instance. * **dimension** (int) – The dimensionality of the search space. **Overload 2:** `create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` Creates a problem instance using the problem ID. **Parameters:** * **problem_id** (int) – The ID of the problem. * **instance_id** (int) – The identifier of the problem instance. * **dimension** (int) – The dimensionality of the search space. ``` -------------------------------- ### WModelOneMax Methods Source: https://iohprofiler.github.io/IOHexperimenter/api/ioh.iohcpp.problem.WModelOneMax.html This section outlines the methods available for interacting with and managing WModelOneMax problem instances, including evaluation, logging, and state manipulation. ```APIDOC ## WModelOneMax Methods ### `__call__` Evaluate the problem. Parameters: **x** (_list_) – the search point to evaluate. It must be a 1-dimensional array/list whose length matches search space’s dimensionality Returns: The evaluated search point Return type: float Evaluate the problem. Parameters: **x** (_list_ _[__list_ _]_) – the search points to evaluate. It must be a 2-dimensional array/list whose length matches search space’s dimensionality Returns: The evaluated search points Return type: list[float] ### `add_constraint` add a constraint ### `attach_logger` Attach a logger to the problem to allow performance tracking. Parameters: **logger** (_Logger_) – A logger-object from the IOHexperimenter logger module. ### `create` Create a problem instance Parameters: * **problem_name** (_a string indicating the problem name._) – * **instance_id** (_an integer identifier_ _of_ _the problem instance_ _,__which seeds the random generation_) – of the tranformations in the search/objective spaces * **dimension** (_integer_ _,__representing the dimensionality_ _of_ _the search space_) – Create a problem instance Parameters: * **problem_id** (_the index_ _of_ _the problem to create._) – * **instance_id** (_an integer identifier_ _of_ _the problem instance_ _,__which seeds the random generation_) – of the tranformations in the search/objective spaces * **dimension** (_integer_ _,__representing the dimensionality_ _of_ _the search space_) – ### `detach_logger` Remove the specified logger from the problem. ### `enforce_bounds` Enforced the bounds (box-constraints) as constraint :param weight: :type weight: The weight for computing the penalty (can be infinity to have strict box-constraints) :param how: :type how: The enforcement strategy, should be one of the ‘ioh.ConstraintEnforcement’ options :param exponent: :type exponent: The exponent for scaling the contraint ### `remove_constraint` remove a constraint ### `reset` Reset all state variables of the problem. ### `set_id` update the problem id ### `set_instance` update the problem instance ### `set_name` update the problem name ### `wmodel_evaluate` On this page * WModelOneMax * `WModelOneMax` * `WModelOneMax.bounds` * `WModelOneMax.constraints` * `WModelOneMax.log_info` * `WModelOneMax.meta_data` ```