### Install IOHexperimenter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/Competitions/Submodular/example_submodular.ipynb Install the IOHexperimenter library using pip. This is the first step before importing and using its functionalities. ```python #%pip install ioh ``` -------------------------------- ### Install IOHexperimenter C++ Package Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp.html Commands to clone, compile, and install the IOHexperimenter package using CMake. Customize the installation path with -DCMAKE_INSTALL_PREFIX. ```bash git clone --recursive https://github.com/IOHprofiler/IOHexperimenter.git cd IOHexperimenter mkdir build cd build cmake .. && make install ``` ```bash cmake -DCMAKE_INSTALL_PREFIX=your/path .. ``` -------------------------------- ### Install IOHExperimenter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/python.html Install the IOHExperimenter library using pip. Ensure you have version 0.3.10 or higher. ```bash pip install ioh>=0.3.10 ``` ```bash pip show ioh ``` -------------------------------- ### Install and show IOH package Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/tutorial.ipynb Installs the IOH package and displays its version information. ```python import ioh %pip show ioh ``` -------------------------------- ### begin Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1suite_1_1_suite-members.html Starts a new experiment run within the Suite. ```APIDOC ## begin ### Description Initiates the start of an experiment run. Optionally tracks problems during the run. ### Method `begin(const bool track_problems = true)` ### Parameters * **track_problems** (bool) - Optional. If true, problems will be tracked during the experiment run. Defaults to true. ``` -------------------------------- ### Install IOHexperimenter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/ioh/README.md Install the IOHexperimenter library using pip. Ensure you are using version 0.3.10 or higher and Python 3.6+. ```bash pip install ioh>=0.3.10 ``` -------------------------------- ### Verify IOHexperimenter Installation Source: https://github.com/iohprofiler/iohexperimenter/blob/master/ioh/README.md Verify the installation of the IOHexperimenter library by checking its installed version. ```bash pip show ioh ``` -------------------------------- ### Example: Logging evaluations, best values, and external parameters Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/group___properties.html This example demonstrates how to configure a Store logger to track the number of evaluations, the best objective function value, and changes to an external variable. Ensure that the variables being watched can be cast to `double`. ```cpp double my_algo_parameter = 42; [ioh::logger::Store](classioh_1_1logger_1_1_store.html) my_store( { [ioh::trigger::always](group___triggers.html#ga0062fbe02ed5dd327b8d34d74f84d7a8) }, { [ioh::watch::evaluations](group___properties.html#gab6f329675f4deebd09b38e283de35ea7), [ioh::watch::transformed_y_best](group___properties.html#gadfe2a79b8d1a64dc7583e2d4b2b07030), [ioh::watch::reference](group___properties.html#gafd4394b92f34c36882441c8804f04c4e)("my_parameter",my_algo_parameter) } ); ``` -------------------------------- ### Clone and Build IOHexperimenter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/README.md Use these commands to download, compile, and install the IOHexperimenter library. CMake flags can customize the installation path and build options. ```sh git clone --recursive https://github.com/IOHprofiler/IOHexperimenter.git cd IOHexperimenter mkdir build cd build cmake .. && make install ``` -------------------------------- ### starting_at Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/functions_func_s.html Specifies the starting point for an iterative process, likely within a trigger mechanism. ```APIDOC ## starting_at() ### Description Defines the initial condition or iteration from which a process should begin. ### Method ``` starting_at() : [ioh::trigger::Each](classioh_1_1trigger_1_1_each.html#a1dcff8cd941c0c5b8b563f9a1550ab55) ``` ``` -------------------------------- ### starting_at Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1trigger_1_1_each-members.html Returns the starting iteration number for the trigger. ```APIDOC ## starting_at ### Description Returns the starting iteration number for the trigger. ### Returns * (const size_t) - The starting iteration number. ``` -------------------------------- ### Experiment Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/python/ioh.html Class to help easily setup benchmarking experiments. ```APIDOC ## Experiment ### Description Class to help easily setup benchmarking experiments. ### Signature `Experiment(algorithm, fids, iids, dims, ...)` ``` -------------------------------- ### instance() Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/functions_func_i.html Gets an instance from the IOH common factory or register with factory. ```APIDOC ## instance() ### Description Gets an instance from the IOH common factory or register with factory. ### Method Not specified (likely a static method). ### Endpoint Not applicable (SDK function). ### Parameters None ### Response Returns an instance from `ioh::common::Factory< AbstractType, Args >` or `ioh::common::RegisterWithFactory< Parent, Args >`. ``` -------------------------------- ### Get Extra Attribute Names in Analyzer Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/analyzer_8hpp_source.html Retrieves names of extra attributes starting from index 5 in the properties vector. This is used to identify custom attributes for experiments. ```cpp std::vector extra_attribute_names() const { std::vector names; for (size_t i = 5; i < properties_vector_.size(); i++) names.push_back(properties_vector_.at(i).get().name()); return names; } ``` -------------------------------- ### begin Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1suite_1_1_integer_suite-members.html Marks the beginning of the suite, optionally tracking problems. ```APIDOC ## begin ### Description Starts the suite and optionally begins tracking problems. ### Method `begin(const bool track_problems = true)` ### Parameters - **track_problems** (bool) - Optional. Whether to track problems. Defaults to true. ``` -------------------------------- ### Get a Specific Star Discrepancy Problem Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/Competitions/StarDiscrepancy/example_star_discr.ipynb Instantiate a specific Star Discrepancy problem using its ID, instance, dimension, and problem class. This example retrieves the 'UniformStarDiscrepancy10' problem. ```python f = ioh.get_problem(30, instance=1, dimension=5, problem_class=ioh.ProblemClass.STAR_REAL) ``` -------------------------------- ### Project and Version Setup Source: https://github.com/iohprofiler/iohexperimenter/blob/master/CMakeLists.txt Initializes the CMake project, sets the version, and specifies the C++ standard. ```cmake cmake_minimum_required(VERSION 3.15) file(READ VERSION VERSION_STRING) string(STRIP ${VERSION_STRING} ${VERSION_STRING}) string(REGEX REPLACE "\n$" "" VERSION_STRING "${VERSION_STRING}") project(ioh VERSION "${VERSION_STRING}" LANGUAGES CXX ) ``` -------------------------------- ### Set up and Run Experiment with Custom Algorithm Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/python.html Initializes an `Experiment` object with a custom algorithm, problem specifications, and lists of attributes to be logged. The experiment is then executed using `exp.run()`. ```python from ioh import Experiment help(Experiment) 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" ] ) exp.run() ``` -------------------------------- ### Initialize and Configure Logger for Tracking Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/python.html Shows how to instantiate a logger, track static and dynamic algorithm attributes, and attach a problem to the logger. This setup is used before running the algorithm on a problem. ```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 ``` -------------------------------- ### Instantiate FlatFile Logger Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Example of how to instantiate the FlatFile logger with specific triggers, properties, and output file configurations. Ensure you define the desired triggers and properties before creating the logger. ```cpp logger::FlatFile( {trigger::always}, {watch::evaluations, watch::transformed_y}, "my_experiment.dat", "./today/" ); ``` -------------------------------- ### Each Trigger Starting Point Getter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/triggers_8hpp_source.html Returns the configured starting evaluation count for the Each trigger. ```cpp size_t starting_at() const { return _starting_at; } ``` -------------------------------- ### Set up Standardized Experiment Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/tutorial.ipynb Configure and run an experiment across multiple problems, instances, and dimensions using the `Experiment` class. This simplifies the setup for systematic evaluation. ```python experiment = ioh.Experiment( algorithm = RandomSearch(10), # An algorithm instance fids = [1, StyblinskiTang_function_identifier], # the id's of the problems we want to test iids = [1, 10], # the instances dims = [2, 10], # the dimensions reps = 3, # the number of runs, zip_output = True, old_logger = True ) ``` -------------------------------- ### Get Problem Help Source: https://github.com/iohprofiler/iohexperimenter/blob/master/ioh/README.md Access the docstrings for the problem module to get more information about precise usage. ```python help(problem) ``` -------------------------------- ### create Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/functions_func_c.html Creates an instance from a factory. ```APIDOC ## create() ### Description Creates an instance of a type managed by a factory. ### Returns [ioh::common::Factory< AbstractType, Args >](structioh_1_1common_1_1_factory.html#a773b0f5292944b23ee1ae864f8e8a8f4) ``` -------------------------------- ### Instantiate Analyzer Logger Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger_analyzer_v1.html Example of how to instantiate the Analyzer logger with specific triggers, properties, and metadata. Ensure the path and names are set correctly for your experiment. ```cpp logger::Analyzer( {trigger::always}, {watch::evaluations, watch::transformed_y}, "~/data", "experiment_folder", "MyOptimizer", "Version 1.0" ); ``` -------------------------------- ### properties_ Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1logger_1_1_watcher.html Map property names to property references. If your logger is handling any property, you can just iterate over them, if you need specific ones, you can call them by their name. This holds reference to optionals, so to get the actual value of a property, you should use `at(…)`, `get()`, ensure that there actually is a valid value, and use `value()` to get it. ```APIDOC ## properties_ ### Description Map property names to property references. If your logger is handling any property, you can just iterate over them, if you need specific ones, you can call them by their name. This holds reference to optionals, so to get the actual value of a property, you should: 1. use `at(…)` and not `operator[]`, 2. use `get()` on the returned element, 3. ensure that there actually is a valid value, 4. use `value()` to get it. ### Example Usage ```cpp // With its name: _properties.at("name").get().value() // If your iterating over the map: for(auto& p : _properties) { p.second.get().value();} ``` ### Checking for Valid Value You can directly test if the property actually has a valid value: ```cpp if(_properties.at("name").get()) {...} ``` ``` -------------------------------- ### Instantiate and Use Trigger with Parameters Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/group___triggers.html Demonstrates how to instantiate a trigger with parameters using a free function and manage its memory. Remember to free the allocated memory after use. ```cpp auto t& = trigger:[at](group___triggers.html#gadc8aea7a9dfbe41f425b6c9fe993337c)({1,10,100}); // [Use t...] delete &t; ``` -------------------------------- ### Generate a range of integers Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/container__utils_8hpp_source.html Creates a std::vector containing integers starting from 'start', up to (but not including) 'stop', with a specified 'step'. Defaults to a step of 1. ```cpp inline std::vector range(const int start, const int stop, const int step = 1){ std::vector v((stop - start) / step); std::generate(v.begin(), v.end(), [=, c=start - step] () mutable { c += step; return c; }); ``` -------------------------------- ### begin Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/functions_func_b.html Returns an iterator to the beginning of a suite, used for iterating through problems within the suite. ```APIDOC ## begin ### Description Returns an iterator pointing to the first element in the suite. ### Usage - `ioh::suite::Suite< ProblemType >::begin()` ``` -------------------------------- ### Get Class Name Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/factory_8hpp_source.html Extracts the class name from a type T. It first gets the full type name, then removes namespace qualifiers and template arguments to return a clean class name. ```cpp template std::string class_name() { auto name = type_name(); name = name.substr(name.find_last_of(' ') + 1); name = name.substr(name.find_last_of("::") + 1); return name = name.substr(0, name.find_first_of(">")); } ``` -------------------------------- ### Track Problem and Initialize File Streams Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/old__csv_8hpp_source.html Sets up the data file streams for a given problem. It creates the necessary directories and filenames based on problem metadata and file configurations. ```cpp void track_problem(const problem::MetaData &meta, const fs::path &root, const bool store_positions) { const auto directory = root / common::string_format("data_f%d_%s", meta.problem_id(structioh_1_1problem_1_1_meta_data.html#a9b4e1b192d991f83864b7ef958288799), meta.name(structioh_1_1problem_1_1_meta_data.html#acb8c5ceb1960e0c37660e668157ffae3).c_str()); for (auto &file : files_) { if (file.active) { if (!exists(directory)) create_directory(directory); auto filename = common::string_format("IOHprofiler_f%d_DIM%d.%sdat", meta.problem_id(structioh_1_1problem_1_1_meta_data.html#a9b4e1b192d991f83864b7ef958288799), meta.n_variables(structioh_1_1problem_1_1_meta_data.html#a67a73db29b3a04908363a1e0a649ce75), file.extension.c_str()); file.stream = common::file::BufferedFileStream(directory, filename); cached_header_ = header(store_positions * meta.n_variables(structioh_1_1problem_1_1_meta_data.html#a67a73db29b3a04908363a1e0a649ce75)); } } } ``` -------------------------------- ### Check or Get Next Available ID Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/factory_8hpp_source.html Retrieves the ID for a given name. If the name is already defined, it returns the existing ID. Otherwise, it calls a helper function to get the next available ID. ```cpp int check_or_get_next_available(const int id, const std::string& name) const { const auto already_defined = name_map.find(name) != std::end(name_map); if(already_defined) for (const auto kv: id_map) if (kv.second == name) return kv.first; return check_or_get_next_available(id); } ``` -------------------------------- ### IntegerStarDiscrepancy.name Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.suite.IntegerStarDiscrepancy.html Gets the name of the IntegerStarDiscrepancy. ```APIDOC ## IntegerStarDiscrepancy.name ### Description Retrieves the name of the IntegerStarDiscrepancy. ### Method `name()` ### Returns String representing the name of the discrepancy. ``` -------------------------------- ### Compute Base Epistasis Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/utils_8hpp_source.html Calculates base epistasis for a given input vector `xIn` within a specified range (`start` to `start + nu - 1`) and stores the result in `xOut`. This is a fundamental step in computing layer epistasis. ```cpp inline void base_epistasis(const std::vector &xIn, const int start, const int nu, std::vector &xOut) { const auto end = start + nu - 1; const auto flip = xIn[start]; auto skip = start; for (auto i = end; i >= start; --i) { auto result = flip; for (auto j = end; j > start; --j) { if (j != skip) { result ^= xIn[j]; } } xOut[i] = result; if (--skip < start) { skip = end; } } } ``` -------------------------------- ### begin Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1suite_1_1_suite.html Returns an iterator to the beginning of the suite, allowing iteration over the problems. An optional parameter can be used to track problems during iteration. ```APIDOC ## begin ### Description Starts iteration over the problems in the suite. ### Parameters - **track_problems** (const bool): If true, problems are tracked during iteration (default: true). ### Returns An [Iterator](structioh_1_1suite_1_1_suite_1_1_iterator.html) to the beginning of the suite. ``` -------------------------------- ### Run and Log an Experiment Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/tutorial.ipynb Sets up a problem, attaches a logger, runs an experiment with a specified algorithm, and closes the logger. ```python problem = ioh.get_problem("StyblinskiTang", instance=1, dimension=2) problem.attach_logger(logger) run_experiment(problem, RandomSearch(10), n_runs=1) logger.close() ``` -------------------------------- ### Configure and Create an Experiment Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/Competitions/SBOX/example_sbox.ipynb Set up an IOHExperiment object to run a specified algorithm over a range of problems, instances, and dimensions. Configure repetitions and problem class. ```python experiment = ioh.Experiment( algorithm = RandomSearch(10), # An algorithm instance fids = [1, 2, 3], # the id's of the problems we want to test iids = [1, 2], # the instances dims = [5, 20], # the dimensions reps = 1, # the number of runs, problem_class=ioh.ProblemClass.SBOX, #the problem type zip_output = True ) ``` -------------------------------- ### watch Method Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1logger_1_1_watcher-members.html Starts watching a specific property. ```APIDOC ## watch(logger::Property &property) ### Description Initiates the watching process for a given property. This method is called internally to start monitoring a property based on the watcher's configured triggers. ### Parameters * **property** (logger::Property &) - The property object to start watching. ``` -------------------------------- ### FlatFile Constructor Parameters Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Demonstrates the various parameters available when constructing a FlatFile logger. This includes defining triggers, properties to watch, filenames, output directories, separators, comment strings, no-value strings, end-of-line characters, and header repetition options. ```cpp inline FlatFile(std::vector> triggers, std::vector> properties, const std::string &filename = "IOH.dat", const fs::path &output_directory = fs::current_path(), const std::string &separator = "\t", const std::string &comment = "# ", const std::string &no_value = "None", const std::string &end_of_line = "\n", const bool repeat_header = false, const bool store_positions = false, const std::vector &common_header_titles = {"suite_name", "problem_name", "problem_id", "problem_instance", "optimization_type", "dimension", "run"}) ``` -------------------------------- ### Get Suite Name Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1suite_1_1_real.html Retrieves the name of the suite. ```APIDOC ## Get Suite Name ### Description Accessor for the `name_` member. ### Signature `std::string name() const` ### Returns A string representing the name of the suite. ``` -------------------------------- ### Run Experiment with Suite and Logger Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/README.md Sets up and runs an experiment using a predefined suite of problems, a logger, and a solver function. The Experimenter class automatically handles the process. ```cpp // You can use ioh::problem::Integer for discrete optimization. void solver(const std::shared_ptr p) { ... } const auto &suite_factory = ioh::suite::SuiteRegistry::instance(); const auto suite = suite_factory.create("BBOB", {1, 2}, {1, 2}, {5, 10}); const auto logger = std::make_shared(std::string("logger-experimenter")); ioh::experiment::Experimenter f(suite, logger, solver, 10); f.run(); ``` -------------------------------- ### EAH::Problem::dim Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Gets the dimension of the problem. ```APIDOC ## EAH::Problem::dim ### Description Gets the dimension of the problem. ### Method `EAH::Problem::dim` ``` -------------------------------- ### Run IOHProfiler Server with Custom Problem Configuration Source: https://github.com/iohprofiler/iohexperimenter/blob/master/server/README.md Configure the server to serve a specific problem type, name, instance, and dimension using command-line options. ```sh ioh-server -t real -p Rosenbrock -i 1 -d 10 query reply ``` -------------------------------- ### EAH::Problem::pb Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Gets the problem data. ```APIDOC ## EAH::Problem::pb ### Description Gets the problem data. ### Method `EAH::Problem::pb` ``` -------------------------------- ### create Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.problem.IntegerStarDiscrepancy.html Create a problem instance. ```APIDOC ## create(problem_name, instance_id, dimension) ### Description Create a problem instance. ### Parameters #### Path 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 ### Returns - **IntegerStarDiscrepancy** - The created problem instance ### Method `create` ``` ```APIDOC ## create(problem_id, instance_id, dimension) ### Description Create a problem instance. ### Parameters #### Path 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 ### Returns - **IntegerStarDiscrepancy** - The created problem instance ### Method `create` ``` -------------------------------- ### current_eah Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/functions_func_c.html Gets the current EAH logger instance. ```APIDOC ## current_eah() ### Description Gets the current instance of the EAH logger. ### Returns [ioh::logger::EAH](classioh_1_1logger_1_1_e_a_h.html#a126bc7db7f0e9690547223ba79ba4d5b) ``` -------------------------------- ### LeadingOnesDummy2.create (Static Method) Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.problem.LeadingOnesDummy2.html Factory method to create instances of the LeadingOnesDummy2 problem. ```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` **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. ### Overload 2: `create(problem_id: int, instance_id: int, dimension: int) -> ioh.iohcpp.problem.PBO` **Parameters**: - **problem_name** (int): A string indicating the problem name. (Note: This parameter name seems inconsistent with the type hint in the source.) - **instance_id** (int): An integer identifier of the problem instance. - **dimension** (int): The dimensionality of the search space. ``` -------------------------------- ### size Method Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1logger_1_1eah_1_1_log10_scale.html Gets the number of buckets in the scale. ```APIDOC ## size Method ### Description Returns the number of buckets. ### Returns - **size_t** - The number of buckets. ``` -------------------------------- ### suite() getter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_experimenter.html Gets the suite associated with the experimenter. ```APIDOC ## suite() ### Description Get method for `suite_`. ### Returns std::shared_ptr<[suite::Suite](classioh_1_1suite_1_1_suite.html) > - The suite object ``` -------------------------------- ### logger() getter Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_experimenter.html Gets the logger associated with the experimenter. ```APIDOC ## logger() ### Description Get method for the logger. ### Returns std::shared_ptr<[Logger](classioh_1_1_logger.html)> - The logger object ``` -------------------------------- ### Create and Configure an Experiment Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/Competitions/Submodular/example_submodular.ipynb Set up an IOHExperiment object to run a specified algorithm over a list of problems. This includes defining the algorithm, problem IDs, number of repetitions, and problem class. ```python experiment = ioh.Experiment( algorithm = RandomSearch(10), # An algorithm instance fids = list(ioh.ProblemClass.GRAPH.problems.keys())[:3], # the id's of the problems we want to test iids = [1], # Ignored but required for graph problems dims = [1], # Ignored but required for graph problems reps = 3, # the number of runs, problem_class = ioh.ProblemClass.GRAPH, #the problem type zip_output = True ) ``` -------------------------------- ### get_type Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_problem-members.html Gets the type or category of the optimization problem. ```APIDOC ## get_type ### Description Returns a string indicating the type or category of the optimization problem (e.g., 'BBOB', 'custom'). ### Method `get_type(self)` ### Response - `str`: The type of the problem. ``` -------------------------------- ### Manage Output Directory and File Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/flatfile_8hpp_source.html Ensures the output directory exists and opens the output file. If the directory does not exist, it is created. The file is closed and reopened if the directory changes. ```cpp if ([output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364) != [output_directory](classioh_1_1logger_1_1_flat_file.html#a784f9acffea9b867a8d5f96fc6365795)) { [output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364) = [output_directory](classioh_1_1logger_1_1_flat_file.html#a784f9acffea9b867a8d5f96fc6365795); if (not exists([output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364))) { IOH_DBG(debug, "some directories do not exist in " << [output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364) << ", try to create them") create_directories([output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364)); } [out_](classioh_1_1logger_1_1_flat_file.html#a8e8dec79e45133358582a65a2e081cf9).close(); } if (![out_](classioh_1_1logger_1_1_flat_file.html#a8e8dec79e45133358582a65a2e081cf9).is_open()) { IOH_DBG(debug, "will output data in " << [output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364) / [filename_](classioh_1_1logger_1_1_flat_file.html#aadb96d9e56d1754955446213856fa78e)) [out_](classioh_1_1logger_1_1_flat_file.html#a8e8dec79e45133358582a65a2e081cf9) = std::ofstream([output_directory_](classioh_1_1logger_1_1_flat_file.html#ad492e04485e744aea669ddb54c9e0364) / [filename_](classioh_1_1logger_1_1_flat_file.html#aadb96d9e56d1754955446213856fa78e)); [requires_header_](classioh_1_1logger_1_1_flat_file.html#ac05164ea4abde8ed2dd4f3c19be83505) = true; } ``` -------------------------------- ### Initializing ioh::logger::Store Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Shows the constructor for ioh::logger::Store, highlighting that it requires at least one logger::Property to be tracked. ```cpp inline Store(std::vector> triggers, std::vector> Attributes) ``` -------------------------------- ### get_number_of_objectives Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_problem-members.html Gets the number of objectives for the optimization problem. ```APIDOC ## get_number_of_objectives ### Description Returns the total number of objectives defined for this problem. ### Method `get_number_of_objectives(self)` ### Response - `int`: The number of objectives. ``` -------------------------------- ### suite Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_experimenter-members.html Gets the experimentation suite associated with the experimenter. ```APIDOC ## suite ### Description Gets the experimentation suite associated with the experimenter. ### Signature ```cpp inline std::shared_ptr< suite::Suite< ProblemType >> suite() const ``` ### Returns * (std::shared_ptr< suite::Suite< ProblemType >>) - The experimentation suite. ``` -------------------------------- ### Run IOHProfiler Server with Default Configuration Source: https://github.com/iohprofiler/iohexperimenter/blob/master/server/README.md Execute the ioh-server, specifying the query and reply pipe paths. ```sh ./server/ioh-server query reply ``` -------------------------------- ### logger Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_experimenter-members.html Gets the logger object associated with the experimenter. ```APIDOC ## logger ### Description Gets the logger object associated with the experimenter. ### Signature ```cpp inline std::shared_ptr< Logger > logger() const ``` ### Returns * (std::shared_ptr< Logger >) - The logger object. ``` -------------------------------- ### IntegerStarDiscrepancy.problem_ids Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.suite.IntegerStarDiscrepancy.html Gets the problem IDs associated with the IntegerStarDiscrepancy. ```APIDOC ## IntegerStarDiscrepancy.problem_ids ### Description Returns a list of problem IDs associated with this IntegerStarDiscrepancy. ### Method `problem_ids()` ### Returns List of integers representing problem IDs. ``` -------------------------------- ### instance Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1common_1_1_factory-members.html Returns the singleton instance of the factory. ```APIDOC ## instance ### Description Returns the singleton instance of the factory. ### Method () ### Return Value Reference to the singleton factory instance. ``` -------------------------------- ### RealState.evaluations Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.RealState.html Gets the total number of evaluations performed. ```APIDOC ## RealState.evaluations ### Description Returns the total number of evaluations that have been performed. ### Method Getter ### Endpoint N/A (Class property/method) ### Parameters None ### Response #### Success Response (200) - **count** (integer) - The total number of evaluations. #### Response Example ```json { "count": 150 } ``` ``` -------------------------------- ### Create WModelLeadingOnes Problem Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/genindex.html Instantiates a WModel Leading Ones problem instance. ```APIDOC ## create WModelLeadingOnes Problem ### Description Creates an instance of the WModel Leading Ones problem. ### Method static create ### Endpoint (Not applicable - this is an SDK method) ### Parameters (No specific parameters documented in the source) ### Request Example (Not applicable) ### Response (Not applicable - returns an instance of the problem) ``` -------------------------------- ### Begin Iteration Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1suite_1_1_integer.html Returns an iterator to the beginning of the Integer suite, optionally tracking problems. ```APIDOC ## Begin Iteration ### Description Returns an iterator pointing to the first problem in the suite. Problem tracking can be enabled or disabled. ### Signature `Iterator begin(const bool track_problems = true)` ### Parameters * **track_problems** (const bool) - Optional. If true, problems are tracked during iteration. Defaults to true. ``` -------------------------------- ### attach_suite Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1logger_1_1_watcher.html Starts a new session for a given suite name. ```APIDOC ## attach_suite ### Description Starts a new session for the given Suite name. ### Signature `virtual void attach_suite(const std::string &suite_name) = 0` ``` -------------------------------- ### Display Experiment Help Source: https://github.com/iohprofiler/iohexperimenter/blob/master/ioh/README.md Displays the help documentation for the Experiment class, providing information on its constructor and available parameters. ```python help(Experiment) ``` -------------------------------- ### Get Suite Name Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1suite_1_1_integer.html Accessor for the name of the Integer suite. ```APIDOC ## Get Suite Name ### Description Returns the name of the Integer suite. ### Signature `std::string name() const` ``` -------------------------------- ### Get Instances Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1suite_1_1_integer.html Accessor for the list of instances for problems in the suite. ```APIDOC ## Get Instances ### Description Returns a constant reference to the vector of instances for the problems in this suite. ### Signature `std::vector instances() const` ``` -------------------------------- ### InstanceBasedProblem Constructor Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_problem.html Loads instances for the problem from a definitions file. ```APIDOC ## InstanceBasedProblem ### Description Method to load instances. ### Template Parameters * **T** – The type of the problem * **Args** – the arguments of the constructor ### Parameters * **definitions** – the file with instance defintions ### Returns Constructors a vector of constrcutor functions ``` -------------------------------- ### Get Dimensions Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/structioh_1_1suite_1_1_integer.html Accessor for the list of dimensions for problems in the suite. ```APIDOC ## Get Dimensions ### Description Returns a constant reference to the vector of dimensions for the problems in this suite. ### Signature `std::vector dimensions() const` ``` -------------------------------- ### Register and Create Suites using Registry Source: https://github.com/iohprofiler/iohexperimenter/blob/master/CONTRIBUTING.md Access the suite registry for a specific objective type to retrieve available suite names and create suite instances. This allows for the creation and iteration over defined suites. ```cpp auto& suitef = ioh::suite::SuiteRegistry::instance(); for (auto xi: suitef.names()) std::cout << xi << "\n"; auto suite = suitef.create("NewProblems", {42}, {1}, {2}); for (auto problem: *suite) std::cout << *problem << "\n"; ``` -------------------------------- ### EAH::Problem::opt Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Gets the optimum value of the problem. ```APIDOC ## EAH::Problem::opt ### Description Gets the optimum value of the problem. ### Method `EAH::Problem::opt` ``` -------------------------------- ### InfoFile Constructor Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/old__csv_8hpp_source.html Initializes the InfoFile class with algorithm name and information. This is used internally by the Default logger. ```cpp InfoFile(std::string algorithm_name, std::string algorithm_info) : algorithm_name_(std::move(algorithm_name)), algorithm_info_(std::move(algorithm_info)) { } ``` -------------------------------- ### EAH::Problem::run Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Gets the number of runs for the problem. ```APIDOC ## EAH::Problem::run ### Description Gets the number of runs for the problem. ### Method `EAH::Problem::run` ``` -------------------------------- ### EAH::Problem::ins Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_logger.html Gets the number of instances for the problem. ```APIDOC ## EAH::Problem::ins ### Description Gets the number of instances for the problem. ### Method `EAH::Problem::ins` ``` -------------------------------- ### Initialize IOHAnalyzer Logger Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/Competitions/Submodular/example_submodular.ipynb Set up an IOHAnalyzer logger to store experiment data. This includes specifying the root directory, folder name, algorithm name, and whether to store positions. ```python import os logger = ioh.logger.Analyzer( root=os.getcwd(), # Store data in the current working directory folder_name="my-experiment", # in a folder named: 'my-experiment' algorithm_name="random-search", # meta-data for the algorithm used to generate these results store_positions=False # disable storing x-variables in the logged files ) # this automatically creates a folder 'my-experiment' in the current working directory # if the folder already exists, it will given an additional number to make the name unique logger ``` -------------------------------- ### reset_transform_variables Method Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1problem_1_1pbo_1_1_one_max_neutrality.html Protected method to get the optimum before transformation. ```APIDOC ## reset_transform_variables(std::vector< int > x) ### Description Optimum before transformation. ### Parameters - **x** (std::vector< int >) - The vector of integer variables. ### Returns std::vector< int > - The optimum variables before transformation. ``` -------------------------------- ### reset_transform_variables Method Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1problem_1_1pbo_1_1_one_max_epistasis.html Protected method to get the optimum before transformation. ```APIDOC ## reset_transform_variables Method ### Description Optimum before transformation. ### Signature `std::vector< int > reset_transform_variables(std::vector< int > x)` ### Parameters * **x** (std::vector< int >) - The vector of integer variables. ### Returns The vector of integer variables representing the optimum before transformation. ``` -------------------------------- ### WModelOneMax Methods Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.problem.WModelOneMax.html This section covers the core methods for interacting with the WModelOneMax problem, including evaluation, state management, and configuration. ```APIDOC ## __call__() ### Description Evaluate the problem with a given search point or a list of search points. ### Method __call__ ### Parameters #### x (list or list[list]) - If `x` is a 1-dimensional list, it represents a single search point. - If `x` is a 2-dimensional list, it represents multiple search points. - The length of the inner list(s) must match the search space's dimensionality. ### Returns - A float representing the objective value for a single search point. - A list of floats representing the objective values for multiple search points. ### Return Type float or list[float] ``` ```APIDOC ## add_constraint() ### Description Adds a constraint to the problem. ### Method add_constraint ``` ```APIDOC ## attach_logger(logger) ### Description Attaches a logger to the problem for performance tracking. ### Method attach_logger ### Parameters - **logger** (Logger) - A logger-object from the IOHexperimenter logger module. ``` ```APIDOC ## create(problem_name, instance_id, dimension) ### Description Creates a problem instance using the problem name, instance ID, and dimensionality. ### Method create ### Parameters - **problem_name** (string) - The name of the problem to create. - **instance_id** (integer) - An integer identifier of the problem instance, which seeds the random generation of transformations. - **dimension** (integer) - The dimensionality of the search space. ``` ```APIDOC ## create(problem_id, instance_id, dimension) ### Description Creates a problem instance using the problem ID, instance ID, and dimensionality. ### Method create ### Parameters - **problem_id** (integer) - The index of the problem to create. - **instance_id** (integer) - An integer identifier of the problem instance, which seeds the random generation of transformations. - **dimension** (integer) - The dimensionality of the search space. ``` ```APIDOC ## detach_logger() ### Description Removes the specified logger from the problem. ### Method detach_logger ``` ```APIDOC ## enforce_bounds(weight, how, exponent) ### Description Enforces the bounds (box-constraints) as a constraint. ### Method enforce_bounds ### Parameters - **weight** - The weight for computing the penalty (can be infinity for strict box-constraints). - **how** - The enforcement strategy, should be one of the `ioh.ConstraintEnforcement` options. - **exponent** - The exponent for scaling the constraint. ``` ```APIDOC ## remove_constraint() ### Description Removes a constraint from the problem. ### Method remove_constraint ``` ```APIDOC ## reset() ### Description Resets all state variables of the problem. ### Method reset ``` ```APIDOC ## set_id() ### Description Updates the problem ID. ### Method set_id ``` ```APIDOC ## set_instance() ### Description Updates the problem instance. ### Method set_instance ``` ```APIDOC ## set_name() ### Description Updates the problem name. ### Method set_name ``` ```APIDOC ## wmodel_evaluate(arg0) ### Description Evaluates the WModelOneMax problem. This method appears to be an alias or specific evaluation function. ### Method wmodel_evaluate ### Parameters - **arg0** - The argument for evaluation, its type and purpose are not fully specified in the provided text. ``` -------------------------------- ### reset_transform_variables Method Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1problem_1_1pbo_1_1_one_max_dummy2.html Protected method to get the optimum before transformation. ```APIDOC ## reset_transform_variables Method ### Description Optimum before transformation. ### Signature `std::vector< int > reset_transform_variables(std::vector< int > x)` ### Parameters * **x** (std::vector< int >) - A vector of integer variables. ### Returns The optimum before transformation. ``` -------------------------------- ### WModelLeadingOnes Methods Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.problem.WModelLeadingOnes.html This section covers the core methods for interacting with the WModelLeadingOnes problem, such as evaluation, constraint management, and state resets. ```APIDOC ## __call__() ### Description Evaluate the problem with a given search point or a list of search points. ### Parameters #### x (list or list[list]) - If x is a list, it represents a single search point. - If x is a list of lists, it represents multiple search points. - The length of the inner list(s) must match the search space's dimensionality. ### Returns - float: If a single search point is evaluated. - list[float]: If multiple search points are evaluated. ## add_constraint() ### Description Adds a constraint to the problem. ## attach_logger(logger) ### Description Attach a logger to the problem to allow performance tracking. ### Parameters - **logger** (Logger): A logger-object from the IOHexperimenter logger module. ## detach_logger() ### Description Remove the specified logger from the problem. ## enforce_bounds(weight, how, exponent) ### Description Enforces the bounds (box-constraints) as a constraint. ### Parameters - **weight** (any): The weight for computing the penalty (can be infinity for strict box-constraints). - **how** (ioh.ConstraintEnforcement): The enforcement strategy. - **exponent** (any): The exponent for scaling the constraint. ## remove_constraint() ### Description Removes a constraint from the problem. ## reset() ### Description Resets all state variables of the problem. ``` -------------------------------- ### WModelOneMax Constructor Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/api/ioh.iohcpp.problem.WModelOneMax.html Initializes a WModelOneMax problem instance with specified parameters. ```APIDOC ## WModelOneMax Constructor ### Description Initializes a WModelOneMax problem instance with specified parameters. ### Method __init__ ### Parameters - **_self** (ioh.iohcpp.problem.WModelOneMax) - The instance of the WModelOneMax class. - **instance** (int) - The instance ID of the problem. - **n_variables** (int) - The number of variables in the problem. - **dummy_select_rate** (float) - Optional. The rate for reducing dummy variables. Defaults to 0.0. - **epistasis_block_size** (int) - Optional. The size of the epistasis block. Defaults to 0. - **neutrality_mu** (int) - Optional. The neutrality parameter mu. Defaults to 0. - **ruggedness_gamma** (int) - Optional. The ruggedness parameter gamma. Defaults to 0. ``` -------------------------------- ### length Method Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1logger_1_1eah_1_1_log2_scale.html Gets the span (max - min) of the scale. ```APIDOC ## length Method ### Description Calculates and returns the total span of the scale, which is the difference between the maximum and minimum values. ### Signature ```cpp R length() const ``` ### Returns * **R** - The span of the scale (max - min). ``` -------------------------------- ### get_upperbound Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_problem-members.html Gets the upper bound of the search space for the problem. ```APIDOC ## get_upperbound ### Description Retrieves the upper bound for each variable in the problem's search space. ### Method `get_upperbound(self)` ### Response - `list`: A list of upper bounds, one for each variable. ``` -------------------------------- ### Run the Experiment Source: https://github.com/iohprofiler/iohexperimenter/blob/master/example/Competitions/Submodular/example_submodular.ipynb Execute the configured IOHExperiment. This will run the specified algorithm on the selected problems and generate a zip-file suitable for IOHAnalyzer. ```python experiment() ``` -------------------------------- ### get_number_of_variables Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/classioh_1_1_problem-members.html Gets the number of decision variables for the optimization problem. ```APIDOC ## get_number_of_variables ### Description Returns the total number of decision variables for this problem. ### Method `get_number_of_variables(self)` ### Response - `int`: The number of variables. ``` -------------------------------- ### Suite::begin Source: https://github.com/iohprofiler/iohexperimenter/blob/master/docs/cpp/ioh_suite.html Returns an iterator to the beginning of the suite, allowing for iteration over the problems. ```APIDOC ## Suite::begin ### Description Starts iteration over the problems in the suite. ### Parameters - **track_problems** (bool, optional) - Whether to track problems during iteration. Defaults to true. ### Returns An `Iterator` object pointing to the first problem. ```