From 094fa76b5823f81f653ef8b4065cd15d7501cfec Mon Sep 17 00:00:00 2001 From: Brett <32377731+Tri11Paragon@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:32:15 -0400 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ae971f4..4465f1c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ # blt-gp Genetic Programming (GP) library for C++. Integrates directly into the C++ type system, a safe replacement for lilgp without performance compromises. -## Easy to use, Safe, and fast, all without compromise +## Easy to use and safe, without compromise Using blt-gp is very easy, import the program header, define your operators, and then call the relevant functions to set up the program to your liking. Concrete examples can be found in the example folder and compiled using the CMake argument `-DBUILD_EXAMPLES=ON` Operator example: ```c++ -// constructor takes an optional string that describes the function of the operator. Used in printing. +// Constructor takes an optional string that describes the function of the operator. Used in printing. blt::gp::operation_t add([](float a, float b) { return a + b; }, "add"); @@ -29,15 +29,17 @@ Please note that if a type doesn't have a way to produce a terminal, or doesn't Defining your fitness function is just as easy: ```c++ const auto fitness_function = [](blt::gp::tree_t& current_tree, blt::gp::fitness_t& fitness, blt::size_t current_index) { - // evaluate your fitness + // Evaluate your fitness // ... - // write to the fitness out parameter. Only "adjusted_fitness" is used during evaluation. + // Write to the fitness out parameter. Only "adjusted_fitness" is used during evaluation. fitness.raw_fitness = static_cast(fitness.hits); fitness.standardized_fitness = fitness.raw_fitness; - // higher values = better. Should be bounded [0, 1] + // Higher values = better. Should be bounded [0, 1] fitness.adjusted_fitness = 1.0 - (1.0 / (1.0 + fitness.standardized_fitness)); // returning true from this function ends the evaluation of the program, as this signals that a valid solution was found. - // this function is allowed to return void. + // This function is allowed to return void. return static_cast(fitness.hits) == training_cases.size(); }; ``` + +## Performance