Brush C++ API
A flexible interpretable machine learning framework
|
The Archive struct represents a collection of individual programs. More...
#include <archive.h>
Public Member Functions | |
Archive () | |
Default constructor for the Archive struct. | |
void | init (Population< T > &pop) |
Initializes the archive with individuals from a population. | |
void | update (Population< T > &pop, const Parameters ¶ms) |
Updates the archive with individuals from a population. | |
void | set_objectives (vector< string > objectives) |
Sets the objectives for the archive. | |
Static Public Member Functions | |
static bool | sortComplexity (const Individual< T > &lhs, const Individual< T > &rhs) |
Sorts the population in increasing complexity. | |
static bool | sortObj1 (const Individual< T > &lhs, const Individual< T > &rhs) |
Sorts the population by the first objective. | |
static bool | sameFitComplexity (const Individual< T > &lhs, const Individual< T > &rhs) |
Checks if two individuals have the same fitness complexity. | |
static bool | sameObjectives (const Individual< T > &lhs, const Individual< T > &rhs) |
Checks if two individuals have the same objectives. | |
Public Attributes | |
vector< Individual< T > > | individuals |
individual programs in the archive | |
bool | sort_complexity |
whether to sort archive by complexity | |
NSGA2< T > | selector |
using NSGA2 in survival mode (nsga2 does not implement selection) | |
The Archive struct represents a collection of individual programs.
The Archive struct is used to store individual programs in a collection. It provides functionality for initializing, updating, and sorting the archive based on complexity or objectives. The archive can be operated on by a single thread.
T | The program type. |
Brush::Pop::Archive< T >::Archive | ( | ) |
Default constructor for the Archive struct.
Definition at line 7 of file archive.cpp.
void Brush::Pop::Archive< T >::init | ( | Population< T > & | pop | ) |
Initializes the archive with individuals from a population.
pop | The population from which to initialize the archive. |
Definition at line 64 of file archive.cpp.
|
static |
Checks if two individuals have the same fitness complexity.
This static function is used to check if two individuals have the same fitness complexity. It is used as a comparison function for finding duplicates in the population.
lhs | The left-hand side individual to compare. |
rhs | The right-hand side individual to compare. |
Definition at line 45 of file archive.cpp.
|
static |
Checks if two individuals have the same objectives.
This static function is used to check if two individuals have the same objectives. It is used as a comparison function for finding duplicates in the population.
lhs | The left-hand side individual to compare. |
rhs | The right-hand side individual to compare. |
Definition at line 56 of file archive.cpp.
void Brush::Pop::Archive< T >::set_objectives | ( | vector< string > | objectives | ) |
Sets the objectives for the archive.
This function sets the objectives for the archive. The objectives are used for sorting the archive.
objectives | The objectives to set for the archive. |
Definition at line 10 of file archive.cpp.
|
static |
Sorts the population in increasing complexity.
This static function is used to sort the population in increasing complexity. It is used as a comparison function for sorting algorithms.
lhs | The left-hand side individual to compare. |
rhs | The right-hand side individual to compare. |
Definition at line 17 of file archive.cpp.
|
static |
Sorts the population by the first objective.
This static function is used to sort the population by the first objective. It is used as a comparison function for sorting algorithms.
lhs | The left-hand side individual to compare. |
rhs | The right-hand side individual to compare. |
Definition at line 29 of file archive.cpp.
void Brush::Pop::Archive< T >::update | ( | Population< T > & | pop, |
const Parameters & | params ) |
Updates the archive with individuals from a population.
pop | The population from which to update the archive. |
params | The parameters for the update. |
Definition at line 108 of file archive.cpp.
vector<Individual<T> > Brush::Pop::Archive< T >::individuals |
NSGA2<T> Brush::Pop::Archive< T >::selector |
bool Brush::Pop::Archive< T >::sort_complexity |