#include <RankingSelection.h>
Inheritance diagram for genetiK::RankingSelection:
Public Member Functions  
RankingSelection (void)  
default constructor  
virtual  ~RankingSelection (void) 
default destructor  
void  init (Population *population) 
initializes the Ranking Selection method with a specific Population  
Individual *  select () 
selects an Individual from the current Population  
Individual *  getBest () 
retrieves the Individual having highest fitness in the Population  
double  phi (unsigned int rank) 
used to calculate the probability to select an Invididual 
This selection scheme is designed to select to individuals with a probability that is function of their specific rank in the population, sorted by (ascending) fitness.
More formally, for a generic individual i
This class uses by default an exponential function to calculate probability (). The probability itself is proportional to phi (it is proportional, but not equal, because the class itself encapsulates normalization). It is possible to override phi to define different selection policies.

retrieves the Individual having highest fitness in the Population
Implements genetiK::SelectionMethod. 

initializes the Ranking Selection method with a specific Population When initializing, the Cumulative Distribution Function (CDF) associated to the probability distribution defined by the previously mentioned function is calculated.
Reimplemented from genetiK::SelectionMethod. 

used to calculate the probability to select an Invididual It is possible to override this function to customize the schema used to calculate probability to select an Individual. This implementation, in particular, defines as .


selects an Individual from the current Population An Individual i will be selected with probability
Implements genetiK::SelectionMethod. 