GaInverseCoupling
coupling takes first parents sequentially from selection results, and second parents are the ones who are at the distance from the last chromosome in selection results which is equal to distance of first parent form first chromosome in result set. If all parents are used, but more children should be produced, this coupling operation wraps-around parent counter and starts from beginning until enough children is produced. When two parents are chosen this operation produces specified number of children using crossover operation and then it chooses child with best fitness value among produced children and first parent is bound to it. This coupling use GaMultipleCrossoverCouplingParams class for parameters.
More...
#include <D:/Temp/vs/gal/source/CouplingOperations.h>
Inherits Population::GaCouplingOperation.
Public Member Functions | |
virtual GAL_API void GACALL | operator() (const GaPopulation &population, GaCouplingResultSet &output, const GaCouplingParams ¶meters, int workerId, int numberOfWorkers) const |
More details are given in specification of GaCouplingOperation::operator () method. | |
virtual GaParameters *GACALL | MakeParameters () const |
More details are given in specification of GaOperation::MakeParameters method. | |
virtual bool GACALL | CheckParameters (const GaParameters ¶meters) const |
Valid parameters must have number of offspring for production and number of produced children per parent pair grater then 0. |
GaInverseCoupling
coupling takes first parents sequentially from selection results, and second parents are the ones who are at the distance from the last chromosome in selection results which is equal to distance of first parent form first chromosome in result set. If all parents are used, but more children should be produced, this coupling operation wraps-around parent counter and starts from beginning until enough children is produced. When two parents are chosen this operation produces specified number of children using crossover operation and then it chooses child with best fitness value among produced children and first parent is bound to it. This coupling use GaMultipleCrossoverCouplingParams class for parameters.
This class has no built-in synchronizator, so LOCK_OBJECT
and LOCK_THIS_OBJECT
macros cannot be used with instances of this class. Because this genetic operation is stateless all public method are thread-safe.
void Population::CouplingOperations::GaInverseCoupling::operator() | ( | const GaPopulation & | population, | |
GaCouplingResultSet & | output, | |||
const GaCouplingParams & | parameters, | |||
int | workerId, | |||
int | numberOfWorkers | |||
) | const [virtual] |
More details are given in specification of GaCouplingOperation::operator () method.
This method is thread-safe.
Implements Population::GaCouplingOperation.
virtual GaParameters* GACALL Population::CouplingOperations::GaInverseCoupling::MakeParameters | ( | ) | const [inline, virtual] |
More details are given in specification of GaOperation::MakeParameters method.
This method is thread-safe.
Implements Common::GaOperation.
virtual bool GACALL Population::CouplingOperations::GaInverseCoupling::CheckParameters | ( | const GaParameters & | parameters | ) | const [inline, virtual] |
Valid parameters must have number of offspring for production and number of produced children per parent pair grater then 0.
More details are given in specification of GaOperation::CheckParameters method.
This method is thread-safe.
Implements Common::GaOperation.