ECF 1.5
Public Member Functions | Protected Attributes | List of all members
SelFitnessProportionalOp Class Reference

Fitness proportional (and inverse proportional) individual selection operator. More...

#include <SelFitnessProportionalOp.h>

Inheritance diagram for SelFitnessProportionalOp:
SelectionOperator

Public Member Functions

bool initialize (StateP)
 Selection operator initialization. Must be called before individual selection. More...
 
IndividualP select (const std::vector< IndividualP > &)
 Select one individual from a set. More...
 
std::vector< IndividualP > selectMany (const std::vector< IndividualP > &, uint)
 Repeatedly select from the same pool (duplicates allowed) More...
 
bool setSelPressure (double)
 Set selection pressure value. More...
 
virtual bool initialize (StateP)=0
 Selection operator initialization. Must be called before individual selection. More...
 
virtual IndividualP select (const std::vector< IndividualP > &)=0
 Select one individual from a set. More...
 

Protected Attributes

double selPressure_
 the ratio of selection probability of the best and worst individual in the set More...
 
- Protected Attributes inherited from SelectionOperator
StateP state_
 

Detailed Description

Fitness proportional (and inverse proportional) individual selection operator.

Functionality
The selection operator assigns a positive value 'S' to each individual, and chooses an individual with proportion to the value 'S'. The selection pressure parameter 'P' states how much is the best individual 'better' than the worst, i.e. how greater chance of selection has the best individual related to the worst one. (the worst individual always has S = 1, and the best S = P)
Inverse proportional selection
For elimination purpose, the P may be set to a value lower than 1; in that case, the worst individual will have the greatest chance of selection, and the best individual the lowest chance.
Examples
  • if P = 10, then the best individual has the selection value 10 and worst value 1
  • if P = 0.1, then the best individual has the selection value 0.1 (i.e. has 10 times lesser chance to be selected than the worst individual!)

Definition at line 26 of file SelFitnessProportionalOp.h.

Member Function Documentation

◆ initialize()

bool SelFitnessProportionalOp::initialize ( StateP  )
virtual

Selection operator initialization. Must be called before individual selection.

Implements SelectionOperator.

Definition at line 8 of file SelFitnessProportionalOp.cpp.

◆ select()

IndividualP SelFitnessProportionalOp::select ( const std::vector< IndividualP > &  )
virtual

Select one individual from a set.

Implements SelectionOperator.

Definition at line 25 of file SelFitnessProportionalOp.cpp.

◆ selectMany()

std::vector< IndividualP > SelFitnessProportionalOp::selectMany ( const std::vector< IndividualP > &  pool,
uint  repeats 
)

Repeatedly select from the same pool (duplicates allowed)

Definition at line 57 of file SelFitnessProportionalOp.cpp.

◆ setSelPressure()

bool SelFitnessProportionalOp::setSelPressure ( double  selPressure)

Set selection pressure value.

Definition at line 15 of file SelFitnessProportionalOp.cpp.

Member Data Documentation

◆ selPressure_

double SelFitnessProportionalOp::selPressure_
protected

the ratio of selection probability of the best and worst individual in the set

Definition at line 29 of file SelFitnessProportionalOp.h.


The documentation for this class was generated from the following files: