Robot Simulator of the Robotics Group for Self-Organization of Control: TournamentSelectStrategy Class Reference

# TournamentSelectStrategy Class Reference

This class makes a select by randomized comparison of two individual of the old generation. More...

`#include <TournamentSelectStrategy.h>`

Inherits ISelectStrategy.

Collaboration diagram for TournamentSelectStrategy:
[legend]

List of all members.

## Public Member Functions
| TournamentSelectStrategy (RandGen *random)
| constructor
virtual | ~TournamentSelectStrategy ()
| default destructor
virtual void | select (Generation *oldGeneration, Generation *newGeneration)
| implementation for the interface ISelectStrategy
## Protected Attributes
RandGen * | m_random
| the random generator

## Detailed Description

This class makes a select by randomized comparison of two individual of the old generation.

The worse individual dosn't comes in the next generation. If enough individual "killed", comes the living in the next generation.

With this method it is possible that a bad individual comes in the next generation. So you dosn't becomes a to elite generation and save some alternatives in the gens. This way is in this point better than the EliteSelectStrategy.

## Constructor & Destructor Documentation

TournamentSelectStrategy | ( | RandGen * | random | ) |

constructor

Parameters:

  | random | (RandGen*) a random generator for the randomized select of two individual.

~TournamentSelectStrategy | ( |  | ) | `[virtual]`

default destructor

## Member Function Documentation

void select | ( | Generation * | oldGeneration,
|  | Generation * | newGeneration |
| ) |  |  | `[virtual]`

implementation for the interface ISelectStrategy

Parameters:

  | oldGeneration | (Generation*) the old generation
  | newGeneration | (Generation*) the next generation

Implements ISelectStrategy.

## Member Data Documentation

RandGen* m_random`[protected]`

the random generator

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

- TournamentSelectStrategy.h
- TournamentSelectStrategy.cpp