Module selection
source code
selection
Contains methods to select individuals from a population. So far
fittest selection and tournament selection are supported.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author:
by Mehdi Khoury
Version:
1.20
Copyright:
(c) 2009 Mehdi Khoury under the mit license
http://www.opensource.org/licenses/mit-license.html
Contact:
mehdi.khoury at gmail.com
|
|
|
|
|
|
|
|
|
TournamentSelectFileOne(size,
pop_file,
prob_selection_fittest)
Select one individual from a file using Tournament selection
appropriate and fast when using a small population (<=1000) |
source code
|
|
|
|
|
|
Function: GetDBKeysAndFitness
the list of fitnesses with associated unique ids obtained from the
database. A lengthy operation. Should be only called once and used as
an argument for the tournament or fitness selection functions.
- Parameters:
|
Function: SelectFileFittest
Select the fittest individual from a file
- Parameters:
|
Function: SelectDBOneFittest
Select fittest individual
- Parameters:
|
Function: SelectDBSeveralFittest
Select n fittest individual
- Parameters:
n - the number of fittest individuals
db_list - the ordered list of fitnesses with associated unique ids obtained
from the database
- Returns:
- the reference of the one fittest individual
|
TournamentSelectFileOne(size,
pop_file,
prob_selection_fittest)
| source code
|
Function: SelectFileOne
Select one individual from a file using Tournament selection
appropriate and fast when using a small population (<=1000)
- Parameters:
size - number of individual choosen at random from the population
pop_file - population file
prob_selection_fittest - prob of selecting the fittest of the group
- Returns:
- the reference of one selected individual with prob of choosing
fittest=p prob of choosing second fittest= p*(1-p) prob of
choosing third fittest= p*((1-p)^2)...
|
TournamentSelectDBOne(size,
prob_selection,
db_list)
| source code
|
Function: SelectDBOne
Select one individual from a database using Tournament selection
- Parameters:
size - number of individual choosen at random from the population
prob_selection - prob of selecting the fittest of the group
db_list - the list of fitnesses with associated unique ids obtained from
the database
- Returns:
- the reference of one selected individual with prob of choosing
fittest=p prob of choosing second fittest= p*(1-p) prob of
choosing third fittest= p*((1-p)^2)...
|
TournamentSelectDBSeveral(nb_outputs,
size,
prob_selection,
db_list)
| source code
|
Function: SelectDBSeveral
Select one individual from a database using Tournament selection
- Parameters:
nb_outputs - repeat the tournament selection nb_outputs times, to return a
list nb_outputs selected individuals
size - number of individual choosen at random from the population
prob_selection - prob of selecting the fittest of the group
db_list - the list of fitnesses with associated unique ids obtained from
the database
- Returns:
- return a list nb_outputs of references of individuals selected by
tournament
|