PaGMO
1.1.5
|
Immune system constraints handling meta-algorithm. More...
#include <cstrs_immune_system.h>
Public Types | |
enum | select_method_type { BEST_ANTIBODY = 0, INFEASIBILITY = 1 } |
Type of immune system antibody selection method. More... | |
enum | inject_method_type { CHAMPION = 0, BEST25 = 1 } |
Type of immune system antibody injection method. More... | |
enum | distance_method_type { HAMMING = 0, EUCLIDEAN = 1 } |
Type of antibodies problem distance method. More... | |
Public Member Functions | |
cstrs_immune_system (const base &=jde(1), const base &=sga(), int gen=1, select_method_type=BEST_ANTIBODY, inject_method_type=CHAMPION, distance_method_type=EUCLIDEAN, double=0.5, double=0.5, double=1./3., double=1e-15, double=1e-15) | |
Constructor. More... | |
cstrs_immune_system (const cstrs_immune_system &) | |
Copy constructor. | |
base_ptr | clone () const |
Clone method. | |
void | evolve (population &) const |
Evolve implementation. More... | |
std::string | get_name () const |
Algorithm name. | |
base_ptr | get_algorithm () const |
Get a copy of the internal local algorithm. More... | |
void | set_algorithm (const base &) |
Set algorithm. More... | |
base_ptr | get_algorithm_immune () const |
Get a copy of the internal local algorithm. More... | |
void | set_algorithm_immune (const base &) |
Set algorithm. More... | |
Public Member Functions inherited from pagmo::algorithm::base | |
base () | |
Default constructor. More... | |
virtual | ~base () |
Trivial destructor. More... | |
std::string | human_readable () const |
Return human readable representation of the algorithm. More... | |
void | set_screen_output (const bool p) |
Setter-Getter for protected m_screen_output data. More... | |
bool | get_screen_output () const |
Gets screen output. More... | |
void | reset_rngs (const unsigned int) const |
Resets the seed of the internal rngs using a user-provided seed. More... | |
Protected Member Functions | |
std::string | human_readable_extra () const |
Extra human readable algorithm info. More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Protected Attributes inherited from pagmo::algorithm::base | |
bool | m_screen_output |
Indicates to the derived class whether to print stuff on screen. | |
rng_double | m_drng |
Random number generator for double-precision floating point values. | |
rng_uint32 | m_urng |
Random number generator for unsigned integer values. | |
unsigned int | m_fevals |
A counter for the number of function evaluations. | |
Immune system constraints handling meta-algorithm.
Immune constraints handling is a meta-algorithm that allow to solve constrained optimization problems. The key idea of this constraint handling technique is to simulate an immune system to drive the unfeasible individuals (called antibodies) towards the feasible individuals (called the antigens).
This meta-algorithm is based on the problem antibodies_problem.
Definition at line 57 of file cstrs_immune_system.h.
Type of antibodies problem distance method.
Two distances are implemented: the hamming and euclidean distances: HAMMING, and EUCLIDEAN.
Definition at line 86 of file cstrs_immune_system.h.
Type of immune system antibody injection method.
Definition of two types of antibody injections method: CHAMPION, and BEST25. The CHAMPION method reinject the best antibody after the immune system simulation into the main population. The BEST25 method reinject the best 25% antibody after the immune system simulation into the main population.
Definition at line 79 of file cstrs_immune_system.h.
Type of immune system antibody selection method.
Definition of two types of antibody selections method: BEST_ANTIBODY, and INFEASIBILITY. The BEST_ANTIBODY, is the selection defined by COELLO, where the antigen population contains only one antigen which is the individual with lowest constraints violation. INFEASIBILITY is an extension where the antigen population contains selected individuals based on their infeasibility.
Definition at line 69 of file cstrs_immune_system.h.
pagmo::algorithm::cstrs_immune_system::cstrs_immune_system | ( | const base & | original_algo = jde(1) , |
const base & | original_algo_immune = sga() , |
||
int | gen = 1 , |
||
select_method_type | select_method = BEST_ANTIBODY , |
||
inject_method_type | inject_method = CHAMPION , |
||
distance_method_type | distance_method = EUCLIDEAN , |
||
double | phi = 0.5 , |
||
double | gamma = 0.5 , |
||
double | sigma = 1./3. , |
||
double | ftol = 1e-15 , |
||
double | xtol = 1e-15 |
||
) |
Constructor.
Constructs an immune system constraints handling algorithm
[in] | original_algo | pagmo::algorithm to use as 'original' optimization method. Its number of generations should be set to 1. |
[in] | original_algo_immune | pagmo::algorithm to use as 'original' optimization method for the immune system |
[in] | gen | number of generations. |
[in] | select_method | the method used for selecting the antibodies. |
[in] | inject_method | the method used for reinjecting the antibodies. |
[in] | distance_method | the method used to compute the antibodies distance |
[in] | phi | the feasible fraction selection to compute the mean value |
[in] | gamma | number of antigens selected / number of total antigens |
[in] | sigma | number of antibodies / number of antigens |
[in] | ftol | stopping criteria on the f tolerance |
[in] | xtol | stopping criteria on the x tolerance |
value_error | if gen is negative |
Definition at line 62 of file cstrs_immune_system.cpp.
|
virtual |
Evolve implementation.
Run the co-evolution algorithm
[in,out] | pop | input/output pagmo::population to be evolved. |
Implements pagmo::algorithm::base.
Definition at line 101 of file cstrs_immune_system.cpp.
base_ptr pagmo::algorithm::cstrs_immune_system::get_algorithm | ( | ) | const |
Get a copy of the internal local algorithm.
Definition at line 492 of file cstrs_immune_system.cpp.
base_ptr pagmo::algorithm::cstrs_immune_system::get_algorithm_immune | ( | ) | const |
Get a copy of the internal local algorithm.
Definition at line 513 of file cstrs_immune_system.cpp.
|
protectedvirtual |
Extra human readable algorithm info.
Reimplemented from pagmo::algorithm::base.
Definition at line 533 of file cstrs_immune_system.cpp.
void pagmo::algorithm::cstrs_immune_system::set_algorithm | ( | const base & | algo | ) |
Set algorithm.
A copy of the input algorithm will be set as the internal local algorithm.
[in] | algo | algorithm to be set as local algorithm. |
Definition at line 524 of file cstrs_immune_system.cpp.
void pagmo::algorithm::cstrs_immune_system::set_algorithm_immune | ( | const base & | algo | ) |
Set algorithm.
A copy of the input algorithm will be set as the internal local algorithm for immune system.
[in] | algo | algorithm to be set as local algorithm. |
Definition at line 504 of file cstrs_immune_system.cpp.