MS-RCPSP
Public Member Functions | Protected Member Functions | List of all members
EvolutionaryAlgorithm::Crossover< T > Class Template Referenceabstract

Abstract base class for crossover implementations. More...

#include <Crossover.h>

Inheritance diagram for EvolutionaryAlgorithm::Crossover< T >:
Inheritance graph
[legend]

Public Member Functions

virtual T * cross (T *a, T *b) const =0
 
bool should_cross () const
 

Protected Member Functions

 Crossover (double _p_cross)
 

Detailed Description

template<class T>
class EvolutionaryAlgorithm::Crossover< T >

Abstract base class for crossover implementations.

If you want to create a new crossover operator, you should create a new subclass of Crossover and implement Crossover::cross function for all specimen representations that you're using. For implementation example see src/UniformCrossover.cpp.

Parameters
TType of specimen representation, subclass of Schedule.

Definition at line 21 of file Crossover.h.

Constructor & Destructor Documentation

template<class T >
EvolutionaryAlgorithm::Crossover< T >::Crossover ( double  _p_cross)
inlineprotected

Creates crossover operator with supplied probability.

Parameters
_p_crossProbability of crossover.

Definition at line 31 of file Crossover.h.

Member Function Documentation

template<class T >
virtual T* EvolutionaryAlgorithm::Crossover< T >::cross ( T *  a,
T *  b 
) const
pure virtual

Takes two specimen and performs crossover on them. Results in a new object.

Implemented in EvolutionaryAlgorithm::LAXCrossover< T >, EvolutionaryAlgorithm::OnePointCrossover< T >, and EvolutionaryAlgorithm::UniformCrossover< T >.

template<class T >
bool EvolutionaryAlgorithm::Crossover< T >::should_cross ( ) const
inline

Checks whether the crossover should take place.

Definition at line 42 of file Crossover.h.


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