OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
#include <Individual.h>
Public Types | |
typedef std::vector< double > | genes_t |
representation of genes More... | |
typedef std::vector< std::string > | names_t |
gene names More... | |
typedef std::vector< double > | objectives_t |
objectives array More... | |
typedef std::vector< std::pair< double, double > > | bounds_t |
bounds on design variables More... | |
typedef Expressions::Named_t | constraints_t |
constraints More... | |
Public Member Functions | |
Individual () | |
Individual (bounds_t gene_bounds, names_t names, constraints_t constraints) | |
create a new individual and initialize with random genes More... | |
Individual (boost::shared_ptr< Individual > individual) | |
copy another individual More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
serialization of structure More... | |
double | new_gene (size_t gene_idx) |
bool | viable () |
test if individual within bounds and constraints More... | |
Public Attributes | |
genes_t | genes_m |
genes of an individual More... | |
objectives_t | objectives_m |
values of objectives of an individual More... | |
unsigned int | id_m = 0 |
id More... | |
Private Member Functions | |
bool | checkBounds () |
check bounds More... | |
bool | checkConstraints () |
check if all constraints on design variables are checked More... | |
Private Attributes | |
bounds_t | bounds_m |
bounds on each gene More... | |
names_t | names_m |
gene names More... | |
constraints_t | constraints_m |
constraints that depend only on design variables More... | |
Definition at line 38 of file Individual.h.
typedef std::vector< std::pair<double, double> > Individual::bounds_t |
bounds on design variables
Definition at line 49 of file Individual.h.
constraints
Definition at line 51 of file Individual.h.
typedef std::vector<double> Individual::genes_t |
representation of genes
Definition at line 43 of file Individual.h.
typedef std::vector<std::string> Individual::names_t |
gene names
Definition at line 45 of file Individual.h.
typedef std::vector<double> Individual::objectives_t |
objectives array
Definition at line 47 of file Individual.h.
|
inline |
Definition at line 53 of file Individual.h.
|
inline |
create a new individual and initialize with random genes
Definition at line 57 of file Individual.h.
References bounds_m, checkConstraints(), endl(), genes_m, names_m, new_gene(), and objectives_m.
|
inline |
copy another individual
Definition at line 86 of file Individual.h.
References bounds_m, constraints_m, genes_m, id_m, names_m, and objectives_m.
|
inlineprivate |
|
inlineprivate |
check if all constraints on design variables are checked
Definition at line 140 of file Individual.h.
References constraints_m, endl(), Expression::evaluate(), Expressions::find(), genes_m, Expression::getReqVars(), and names_m.
Referenced by Individual(), and viable().
|
inline |
initialize the gene with index gene_idx with a new random value contained in the specified gene boundaries
Definition at line 105 of file Individual.h.
References abs(), bounds_m, genes_m, max(), and min().
Referenced by Individual().
|
inline |
serialization of structure
Definition at line 97 of file Individual.h.
References genes_m, id_m, and objectives_m.
|
inline |
test if individual within bounds and constraints
Definition at line 113 of file Individual.h.
References checkBounds(), and checkConstraints().
|
private |
bounds on each gene
Definition at line 170 of file Individual.h.
Referenced by checkBounds(), Individual(), and new_gene().
|
private |
constraints that depend only on design variables
Definition at line 174 of file Individual.h.
Referenced by checkConstraints(), and Individual().
genes_t Individual::genes_m |
genes of an individual
Definition at line 118 of file Individual.h.
Referenced by checkBounds(), checkConstraints(), Individual(), new_gene(), and serialize().
unsigned int Individual::id_m = 0 |
|
private |
gene names
Definition at line 172 of file Individual.h.
Referenced by checkConstraints(), and Individual().
objectives_t Individual::objectives_m |
values of objectives of an individual
Definition at line 120 of file Individual.h.
Referenced by Individual(), and serialize().