GaPopulation
class is used to host chromosomes. Population also provides statistical information about chromosomes in population by using GaStatistics class. Same chromosome can be hosted by multiple populations because they are stored in population using scaled chromosome object which contains smart pointer to chromosome and value of scaled fitness (because this value depends on population, but not on chromosome itself and same chromosome can be in multiple populations). Chromosomes in population can be sorted which provides easy way of tracking best and worst chromosomes, but if chromosomes are not sorted, population provides to sorted groups which stores indices of best and worst chromosomes. Sorting of chromosomes in population or in sorted groups is done my using provided sorting comparator. Both scaled and non-scaled fitness values of chromosomes can be used for sorting, which value is going to be used depends on specified parameters, but if scaling operation is not defined for the population, non-scaled fitness values are used. Maximal number of chromosomes which can be hosted is specified in population's parameters. Also whether the population is going to be fixed-size (number of chromosomes in population is always equals to maximal number of chromosomes it can store) or resizable (population can host from 0 to maximal number of chromosomes) is specified in population's parameters. During population initialization, provided prototype is used to create chromosomes which fill the population. Fixed-size populations are always filled during initialization, which is not the case with resizable populations. Besides hosting of chromosomes, population also binds extern genetic operations (selection, coupling, scaling, and replacement) which are going to be used by genetic algorithm during evolution.
More...
#include <D:/Temp/vs/gal/source/Population.h>
Public Member Functions | |
GAL_API | GaPopulation (GaChromosome *prototype, GaPopulationConfiguration *configuration) |
This constructor initializes population with its configuration and prototype chromosomes. It also allocates memory for array which is used to store chromosomes, and initializes sorted groups which keep track of best and worst chromosomes. | |
GAL_API | ~GaPopulation () |
Destructor frees memory used by scaled chromosome objects which are hosted in population and array which stores them. | |
GAL_API GaPopulation *GACALL | Clone (bool copyChromosomes) const |
Clone method makes copy of population's object. It can make copy of whole object (with setup and chromosomes) or it can make empty copy of population's object (only setup, without coping chromosomes). Copying of chromosomes is done by making new scaled chromosomes object which holds smart pointers to same chromosomes. Caller is responsible for memory allocated by this method for new population's object. | |
GAL_API void GACALL | InitializePopulation (bool fill=true) |
This method removes all chromosomes from population and clears sorted group and statistical information. If population is not resizable or user specified so, population is filled with new chromosomes which are built based on provided prototype, also it sorts new chromosomes if needed and update sorted groups and statistical information. | |
GAL_API int GACALL | GetBestChromosomes (int *results, int start, int numberOfChromosomes) const |
This method fills provided array with indices of best chromosomes in population. If population is not sorted this method can only provide number of best chromosomes which is equal to number of tracked best chromosomes. | |
GAL_API int GACALL | GetBestChromosomes (GaChromosomePtr *results, int start, int numberOfChromosomes) const |
This method fills provided array with smart pointer to best chromosomes in population. If population is not sorted this method can only provide number of best chromosomes which is equal to number of tracked best chromosomes. | |
GAL_API int GACALL | GetWorsChromosomes (int *results, int start, int numberOfChromosomes) const |
This method fills provided array with smart pointer to worst chromosomes in population. If population is not sorted this method can only provide number of worst chromosomes which is equal to number of tracked worst chromosomes. | |
GAL_API int GACALL | GetWorsChromosomes (GaChromosomePtr *results, int start, int numberOfChromosomes) const |
This method fills provided array with indices of worst chromosomes in population. If population is not sorted this method can only provide number of worst chromosomes which is equal to number of tracked worst chromosomes. | |
GAL_API int GACALL | Replace (int index, GaChromosomePtr newChromosome) |
Replace method removes chromosome with specified index from population and insert new chromosome. Scaled fitness value of new chromosome is automatically calculated. This method preserve sorting of chromosomes and update sorted group and statistical information. | |
GAL_API int GACALL | ReplaceGroup (int *indices, GaChromosomePtr *newChromosomes, int numberOfChromosomes) |
Replace method removes group of chromosomes with specified indices from population and insert new chromosomes. Scaled fitness values of new chromosomes are automatically calculated. If index of one chromosome in specified more then once in array of chromosomes which should be removed, results are unexpected and may lead to failures. This method preserve sorting of chromosomes and update sorted group and statistical information. | |
GAL_API int GACALL | Insert (GaChromosomePtr chromosome) |
Insert method inserts new chromosome into population. If population is not sorted new chromosome can be inserted if population is resizable and is not full. If population is sorted new chromosome is inserted at appropriate place (according to sorting policy), but if population is fixed-size or resizable but full, this method virtually extends population size by one before it inserts chromosome, after inserting it removes chromosome with worst fitness value (new chromosome is also included). This method preserve sorting of chromosomes and update sorted group and statistical information. | |
GAL_API int GACALL | InsertGroup (GaChromosomePtr *chromosomes, int numberOfChromosomes) |
Insert method inserts new chromosomes into population. If population is not sorted new chromosomes can be inserted if population is resizable and is not full, if there is more new chromosomes then space in population, only first chromosomes are inserted. If population is sorted new chromosomes are inserted at appropriate places (according to sorting policy), but if population is fixed-size or resizable but full, this method virtually extends population size so it is able to host all chromosome before it inserts chromosomes, after inserting it removes chromosomes with worst fitness values(new chromosomes are also included). This method preserve sorting of chromosomes and update sorted group and statistical information. | |
GAL_API int GACALL | Remove (int chromosome) |
Remove method removes chromosome with specified index from population. To remove chromosome from population, it must be resizable. This method preserve sorting of chromosomes and update sorted group and statistical information. | |
GAL_API int GACALL | RemoveGroup (int *chromosomes, int numberOfChromosomes) |
Remove method removes chromosomes with specified indices from population. To remove chromosomes from population, it must be resizable. If index of one chromosome in specified more then once in array of chromosomes which should be removed, results are unexpected and may lead to failures. This method preserve sorting of chromosomes and update sorted group and statistical information. | |
void GACALL | NextGeneration () |
NextGeneration method prepares population for new generation. It should be called before new cycle of execution of genetic operations by genetic algorithm. | |
void GACALL | EndOfGeneration (const GaPopulation &previous) |
EndOfGeneration method is used for evolutions with non-overlapping population. It is used to finalize cycle of genetic operations' execution and should be called by genetic algorithm at the end of a generation. | |
void GACALL | EndOfGeneration () |
EndOfGeneration method is used for evolutions with overlapping population. It is used to finalize cycle of genetic operations' execution and should be called by genetic algorithm at the end of a generation. | |
GAL_API void GACALL | Clear (bool clearStatistics) |
Clear method removes all chromosomes form population and clears statistical information if specified. | |
GAL_API int GACALL | GetChromosomeRanking (int chromosomeIndex, bool reverse=false) |
GetChromosomeRanking method returns ranking of chromosomes with specified index based on its fitness value (scaled or non-scaled). If population is sorted, all chromosomes has ranking. If it is unsorted only chromosomes in best and worst sorted groups has ranking. Also inverse chromosome ranking can be queried. | |
GaScaledChromosome &GACALL | GetAt (int position) const |
This method is not thread-safe. | |
const GaStatistics &GACALL | GetStatistics () const |
This method is not thread-safe. | |
const GaPopulationConfiguration & | GetConfiguration () const |
This method is not thread-safe. | |
void | SetConfiguration (GaPopulationConfiguration *configuration) |
SetConfiguration method sets population's configuration. | |
bool GACALL | IsScaledFitnessUsed () |
This method is not thread-safe. | |
const GaChromosome &GACALL | GetPrototype () const |
This method is not thread-safe. | |
int GACALL | GetCurrentSize () const |
This method is not thread-safe. | |
Private Member Functions | |
GAL_API void | SetParameters (const GaPopulationParameters ¶meters) |
SetParameters method sets parameters of population. It copies values of parameters into built-in parameters' object of population and updates population according to new parameters. | |
GAL_API void | SetSortComparator (const GaFitnessComparator *comparator) |
SetSortComaprator method sets fitness comparator which is used for sorting chromosomes. It update sorting of chromosomes, sorted groups and statistical information according to new sorting policy. | |
void GACALL | RefreshBestGroup () |
RefreshBestGroup method refreshes content of best sorted group. | |
void GACALL | RefreshWorstGroup () |
RefreshWorstGroup method refreshes content of worst sorted group. This method is not thread-safe. | |
GAL_API void GACALL | UpdateStatistics (float fitnessChange, float scaledFitnessChange) |
UpdateStatistics method updates all population statistics. This method is not thread-safe. | |
GAL_API void GACALL | RescaleAll () |
RescaleAll method recalculates scaled fitness values of all chromosomes in population and stores them. It also updates population statistics. | |
GAL_API void GACALL | ResortPopulation (bool refreshFitnesses, bool scalingChanged, bool comparatorChanged) |
ResortPopulation method resorts population when some of part of sorting policy is changed. After resorting, method updates statistics. If population is not sorted, this method updates sorted group. | |
Static Private Member Functions | |
static GAL_API int APICALL | SortComparison (const void *first, const void *second) |
This method is used by CRT's qsort function for sorting array which stores chromosomes. | |
Private Attributes | |
DEFINE_SYNC_CLASS | |
bool | _usingScaledFitness |
If this attribute is set to true , scaled fitness values are used for sorting chromosomes in population. If it is set to false , original (non-scaled) fitness values are used. Value of this attribute is copied from population's parameters. | |
int | _currentSize |
Number of chromosomes currently in population. | |
GaStatistics | _statistics |
Statistical information about population. | |
GaScaledChromosome ** | _chromosomes |
Pointer to array of scaled chromosome objects. Chromosomes which belong to population are stored in this array. | |
GaChromosome * | _prototype |
Pointer to chromosome which represents prototype for initialization of population. | |
GaSortedGroup | _best |
This sorted group keeps track of best chromosomes in population. If population is sorted, this group is ignored. Group uses same fitness comparator for sorting as population. | |
GaSortedGroup | _worst |
This sorted group keeps track of worst chromosomes in population. If population is sorted, this group is ignored. Group uses same fitness comparator for sorting as population, but it inverse results of comparisons in order to provide inverse sorting of chromosomes. | |
GaPopulationConfiguration * | _configuration |
GaPopulationParameters | _parameters |
Population's parameters. | |
Friends | |
class | GaPopulationConfiguration |
GaPopulation
class is used to host chromosomes. Population also provides statistical information about chromosomes in population by using GaStatistics class. Same chromosome can be hosted by multiple populations because they are stored in population using scaled chromosome object which contains smart pointer to chromosome and value of scaled fitness (because this value depends on population, but not on chromosome itself and same chromosome can be in multiple populations). Chromosomes in population can be sorted which provides easy way of tracking best and worst chromosomes, but if chromosomes are not sorted, population provides to sorted groups which stores indices of best and worst chromosomes. Sorting of chromosomes in population or in sorted groups is done my using provided sorting comparator. Both scaled and non-scaled fitness values of chromosomes can be used for sorting, which value is going to be used depends on specified parameters, but if scaling operation is not defined for the population, non-scaled fitness values are used. Maximal number of chromosomes which can be hosted is specified in population's parameters. Also whether the population is going to be fixed-size (number of chromosomes in population is always equals to maximal number of chromosomes it can store) or resizable (population can host from 0 to maximal number of chromosomes) is specified in population's parameters. During population initialization, provided prototype is used to create chromosomes which fill the population. Fixed-size populations are always filled during initialization, which is not the case with resizable populations. Besides hosting of chromosomes, population also binds extern genetic operations (selection, coupling, scaling, and replacement) which are going to be used by genetic algorithm during evolution.
This class has built-in synchronizator so it is allowed to use LOCK_OBJECT
and LOCK_THIS_OBJECT
macros with instances of this class. No public or private methods are thread-safe.
Population::GaPopulation::GaPopulation | ( | GaChromosome * | prototype, | |
GaPopulationConfiguration * | configuration | |||
) |
This constructor initializes population with its configuration and prototype chromosomes. It also allocates memory for array which is used to store chromosomes, and initializes sorted groups which keep track of best and worst chromosomes.
prototype | pointer to chromosomes which is prototype for making chromosomes during population initialization. | |
configuration | pointer to population's configuration. |
Population::GaPopulation::~GaPopulation | ( | ) |
Destructor frees memory used by scaled chromosome objects which are hosted in population and array which stores them.
GaPopulation * Population::GaPopulation::Clone | ( | bool | copyChromosomes | ) | const |
Clone
method makes copy of population's object. It can make copy of whole object (with setup and chromosomes) or it can make empty copy of population's object (only setup, without coping chromosomes). Copying of chromosomes is done by making new scaled chromosomes object which holds smart pointers to same chromosomes. Caller is responsible for memory allocated by this method for new population's object.
This method is not thread-safe.
copyChromosomes | if this parameter is set to true , both setup and chromosomes are copied to new object, otherwise new object is empty, but with same setup. |
void Population::GaPopulation::InitializePopulation | ( | bool | fill = true |
) |
This method removes all chromosomes from population and clears sorted group and statistical information. If population is not resizable or user specified so, population is filled with new chromosomes which are built based on provided prototype, also it sorts new chromosomes if needed and update sorted groups and statistical information.
This method is not thread-safe.
fill | if this parameter is set to true , population is filled wit new chromosomes built on specified prototype. If this parameter is set to false , population is only cleared. This parameter is ignored if population is not resizable, and population is always filled. |
int Population::GaPopulation::GetBestChromosomes | ( | int * | results, | |
int | start, | |||
int | numberOfChromosomes | |||
) | const |
This method fills provided array with indices of best chromosomes in population. If population is not sorted this method can only provide number of best chromosomes which is equal to number of tracked best chromosomes.
This method is not thread-safe.
results | pointer to array which is going to be filled. | |
start | index of the first best chromosome which is going to be copied. | |
numberOfChromosomes | number of queried chromosomes' indices. |
int Population::GaPopulation::GetBestChromosomes | ( | GaChromosomePtr * | results, | |
int | start, | |||
int | numberOfChromosomes | |||
) | const |
This method fills provided array with smart pointer to best chromosomes in population. If population is not sorted this method can only provide number of best chromosomes which is equal to number of tracked best chromosomes.
This method is not thread-safe.
results | pointer to array which is going to be filled. | |
start | index of the first best chromosome which is going to be copied. | |
numberOfChromosomes | number of queried chromosome' indices. |
int Population::GaPopulation::GetWorsChromosomes | ( | int * | results, | |
int | start, | |||
int | numberOfChromosomes | |||
) | const |
This method fills provided array with smart pointer to worst chromosomes in population. If population is not sorted this method can only provide number of worst chromosomes which is equal to number of tracked worst chromosomes.
This method is not thread-safe.
results | pointer to array which is going to be filled. | |
start | index of the last worst chromosome which is going to be copied. | |
numberOfChromosomes | number of queried chromosome' indices. |
int Population::GaPopulation::GetWorsChromosomes | ( | GaChromosomePtr * | results, | |
int | start, | |||
int | numberOfChromosomes | |||
) | const |
This method fills provided array with indices of worst chromosomes in population. If population is not sorted this method can only provide number of worst chromosomes which is equal to number of tracked worst chromosomes.
This method is not thread-safe.
results | pointer to array which is going to be filled. | |
start | index of the last worst chromosome which is going to be copied. | |
numberOfChromosomes | number of queried chromosome' indices. |
int Population::GaPopulation::Replace | ( | int | index, | |
GaChromosomePtr | newChromosome | |||
) |
Replace
method removes chromosome with specified index from population and insert new chromosome. Scaled fitness value of new chromosome is automatically calculated. This method preserve sorting of chromosomes and update sorted group and statistical information.
This method is not thread-safe.
index | index of chromosome which is going to be removed. | |
newChromosome | smart pointer to chromosome which is going to be inserted into population. |
int Population::GaPopulation::ReplaceGroup | ( | int * | indices, | |
GaChromosomePtr * | newChromosomes, | |||
int | numberOfChromosomes | |||
) |
Replace
method removes group of chromosomes with specified indices from population and insert new chromosomes. Scaled fitness values of new chromosomes are automatically calculated. If index of one chromosome in specified more then once in array of chromosomes which should be removed, results are unexpected and may lead to failures. This method preserve sorting of chromosomes and update sorted group and statistical information.
This method is not thread-safe.
indices | pointer to array of indices of chromosomes which are going to be removed. | |
newChromosomes | pointer to array of smart pointer to chromosomes which are going to be inserted into population. | |
numberOfChromosomes | number of chromosomes which are going to be replaced. |
int Population::GaPopulation::Insert | ( | GaChromosomePtr | chromosome | ) |
Insert
method inserts new chromosome into population. If population is not sorted new chromosome can be inserted if population is resizable and is not full. If population is sorted new chromosome is inserted at appropriate place (according to sorting policy), but if population is fixed-size or resizable but full, this method virtually extends population size by one before it inserts chromosome, after inserting it removes chromosome with worst fitness value (new chromosome is also included). This method preserve sorting of chromosomes and update sorted group and statistical information.
This method is not thread-safe.
chromosome | smart pointer to chromosome which is going to be inserted into population. |
int Population::GaPopulation::InsertGroup | ( | GaChromosomePtr * | chromosomes, | |
int | numberOfChromosomes | |||
) |
Insert
method inserts new chromosomes into population. If population is not sorted new chromosomes can be inserted if population is resizable and is not full, if there is more new chromosomes then space in population, only first chromosomes are inserted. If population is sorted new chromosomes are inserted at appropriate places (according to sorting policy), but if population is fixed-size or resizable but full, this method virtually extends population size so it is able to host all chromosome before it inserts chromosomes, after inserting it removes chromosomes with worst fitness values(new chromosomes are also included). This method preserve sorting of chromosomes and update sorted group and statistical information.
This method is not thread-safe.
chromosomes | pointer to array of smart pointer to chromosomes which are going to be inserted into population. | |
numberOfChromosomes | number of chromosomes which should be inserted. |
int Population::GaPopulation::Remove | ( | int | chromosome | ) |
Remove
method removes chromosome with specified index from population. To remove chromosome from population, it must be resizable. This method preserve sorting of chromosomes and update sorted group and statistical information.
This method is not thread-safe.
chromosome | index of chromosome which is going to be removed. |
int Population::GaPopulation::RemoveGroup | ( | int * | chromosomes, | |
int | numberOfChromosomes | |||
) |
Remove
method removes chromosomes with specified indices from population. To remove chromosomes from population, it must be resizable. If index of one chromosome in specified more then once in array of chromosomes which should be removed, results are unexpected and may lead to failures. This method preserve sorting of chromosomes and update sorted group and statistical information.
This method is not thread-safe.
chromosomes | pointer to array of indices of chromosomes which are going to be removed. | |
numberOfChromosomes | number of chromosomes which are going to be removed. |
void GACALL Population::GaPopulation::NextGeneration | ( | ) | [inline] |
NextGeneration
method prepares population for new generation. It should be called before new cycle of execution of genetic operations by genetic algorithm.
This method is not thread-safe.
void GACALL Population::GaPopulation::EndOfGeneration | ( | const GaPopulation & | previous | ) | [inline] |
EndOfGeneration
method is used for evolutions with non-overlapping population. It is used to finalize cycle of genetic operations' execution and should be called by genetic algorithm at the end of a generation.
This method is not thread-safe.
previous | reference to population which is used in previous generation by the algorithm. |
void GACALL Population::GaPopulation::EndOfGeneration | ( | ) | [inline] |
EndOfGeneration
method is used for evolutions with overlapping population. It is used to finalize cycle of genetic operations' execution and should be called by genetic algorithm at the end of a generation.
This method is not thread-safe.
void Population::GaPopulation::Clear | ( | bool | clearStatistics | ) |
Clear
method removes all chromosomes form population and clears statistical information if specified.
This method is not thread-safe.
clearStatistics | if this parameter is set to true , method clears statistics and removes chromosomes, otherwise it keeps statistics. |
int Population::GaPopulation::GetChromosomeRanking | ( | int | chromosomeIndex, | |
bool | reverse = false | |||
) |
GetChromosomeRanking
method returns ranking of chromosomes with specified index based on its fitness value (scaled or non-scaled). If population is sorted, all chromosomes has ranking. If it is unsorted only chromosomes in best and worst sorted groups has ranking. Also inverse chromosome ranking can be queried.
This method is not thread-safe.
chromosomeIndex | index of chromosome which rank is queried. | |
reverse | if this is set to true , inverse ranking is queried, otherwise normal ranking is queried. |
GaScaledChromosome& GACALL Population::GaPopulation::GetAt | ( | int | position | ) | const [inline] |
This method is not thread-safe.
position | index of chromosome. |
const GaStatistics& GACALL Population::GaPopulation::GetStatistics | ( | ) | const [inline] |
This method is not thread-safe.
const GaPopulationConfiguration& Population::GaPopulation::GetConfiguration | ( | ) | const [inline] |
This method is not thread-safe.
void Population::GaPopulation::SetConfiguration | ( | GaPopulationConfiguration * | configuration | ) | [inline] |
SetConfiguration
method sets population's configuration.
This method is not thread-safe.
configuration | pointer to new configuration object. |
bool GACALL Population::GaPopulation::IsScaledFitnessUsed | ( | ) | [inline] |
This method is not thread-safe.
true
if population use scale fitness values for sorting. If population use non-scaled fitness values, it returns false
. const GaChromosome& GACALL Population::GaPopulation::GetPrototype | ( | ) | const [inline] |
This method is not thread-safe.
int GACALL Population::GaPopulation::GetCurrentSize | ( | ) | const [inline] |
This method is not thread-safe.
void Population::GaPopulation::SetParameters | ( | const GaPopulationParameters & | parameters | ) | [private] |
SetParameters
method sets parameters of population. It copies values of parameters into built-in parameters' object of population and updates population according to new parameters.
This method is not thread-safe.
parameters | reference to object of new population's parameters. |
void Population::GaPopulation::SetSortComparator | ( | const GaFitnessComparator * | comparator | ) | [private] |
SetSortComaprator
method sets fitness comparator which is used for sorting chromosomes. It update sorting of chromosomes, sorted groups and statistical information according to new sorting policy.
This method is not thread-safe.
comparator | pointer to new fitness comparator. |
void GACALL Population::GaPopulation::RefreshBestGroup | ( | ) | [inline, private] |
RefreshBestGroup
method refreshes content of best sorted group.
This method is not thread-safe.
void GACALL Population::GaPopulation::RefreshWorstGroup | ( | ) | [inline, private] |
RefreshWorstGroup
method refreshes content of worst sorted group. This method is not thread-safe.
void Population::GaPopulation::UpdateStatistics | ( | float | fitnessChange, | |
float | scaledFitnessChange | |||
) | [private] |
UpdateStatistics
method updates all population statistics. This method is not thread-safe.
fitnessChange | value by which sum of non-scaled fitness values of all chromosomes in population has change after last update. | |
scaledFitnessChange | value by which sum of scaled fitness values of all chromosomes in population has change after last update. |
void Population::GaPopulation::RescaleAll | ( | ) | [private] |
RescaleAll
method recalculates scaled fitness values of all chromosomes in population and stores them. It also updates population statistics.
void Population::GaPopulation::ResortPopulation | ( | bool | refreshFitnesses, | |
bool | scalingChanged, | |||
bool | comparatorChanged | |||
) | [private] |
ResortPopulation method resorts population when some of part of sorting policy is changed. After resorting, method updates statistics. If population is not sorted, this method updates sorted group.
This method is not thread-safe.
refreshFitnesses | if this parameter is set to true, before resorting all fitness values should be recalculated (i.e. after change of fitness operation). | |
scalingChanged | if this parameter is set to true, before resorting all scaled fitness values should be recalculated (i.e. after change of scaling operation). | |
comparatorChanged | this parameter indicates that fitness comparator which is used for sorting has changed. |
int Population::GaPopulation::SortComparison | ( | const void * | first, | |
const void * | second | |||
) | [static, private] |
This method is used by CRT's qsort
function for sorting array which stores chromosomes.
friend class GaPopulationConfiguration [friend] |
bool Population::GaPopulation::_usingScaledFitness [private] |
If this attribute is set to true
, scaled fitness values are used for sorting chromosomes in population. If it is set to false
, original (non-scaled) fitness values are used. Value of this attribute is copied from population's parameters.
int Population::GaPopulation::_currentSize [private] |
Number of chromosomes currently in population.
Statistical information about population.
Pointer to array of scaled chromosome objects. Chromosomes which belong to population are stored in this array.
GaChromosome* Population::GaPopulation::_prototype [private] |
Pointer to chromosome which represents prototype for initialization of population.
GaSortedGroup Population::GaPopulation::_best [private] |
This sorted group keeps track of best chromosomes in population. If population is sorted, this group is ignored. Group uses same fitness comparator for sorting as population.
This sorted group keeps track of worst chromosomes in population. If population is sorted, this group is ignored. Group uses same fitness comparator for sorting as population, but it inverse results of comparisons in order to provide inverse sorting of chromosomes.
Population's parameters.