PaGMO  1.1.5
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends
pagmo::migration::base Class Reference

Base migration class. More...

#include <base.h>

Inheritance diagram for pagmo::migration::base:
Inheritance graph
[legend]

Public Member Functions

 base (const double &, rate_type)
 Constructor from migration rate and type. More...
 
population::size_type get_n_individuals (const population &) const
 Get number of individuals to migrate from/to input population. More...
 
std::string human_readable () const
 Return human readable representation. More...
 
virtual ~base ()
 Destructor. More...
 

Protected Member Functions

virtual std::string human_readable_extra () const
 Return extra information in human readable representation. More...
 

Static Protected Member Functions

template<class ForwardIterator , class T >
static void iota (ForwardIterator first, ForwardIterator last, T value)
 Iota function, usefull to fill iterator range with increasing values. More...
 

Protected Attributes

double m_rate
 Migration rate. More...
 
rate_type m_type
 Migration rate type.
 

Friends

class boost::serialization::access
 

Detailed Description

Base migration class.

Embeds two properties used both in selection and replacement policies:

The get_n_individuals() method returns the number of individuals to be selected/replaced in the given population, according to the properties above.

Author
Francesco Biscani (blues.nosp@m.carn.nosp@m.i@gma.nosp@m.il.c.nosp@m.om)
Marek RuciƄski (marek.nosp@m..ruc.nosp@m.inski.nosp@m.@gma.nosp@m.il.co.nosp@m.m)

Definition at line 69 of file migration/base.h.

Constructor & Destructor Documentation

pagmo::migration::base::base ( const double &  rate,
rate_type  type 
)

Constructor from migration rate and type.

If migration type is absolute, then the input rate will be converted to the nearest integer. Will fail if rate is outside the [0,INT_MAX] range.

If migration type is fractional, the constructor will fail if rate is outside the [0,1] range.

Parameters
[in]ratemigration rate.
[in]typemigration rate type.

Definition at line 49 of file migration/base.cpp.

pagmo::migration::base::~base ( )
virtual

Destructor.

No side effects.

Definition at line 142 of file migration/base.cpp.

Member Function Documentation

population::size_type pagmo::migration::base::get_n_individuals ( const population pop) const

Get number of individuals to migrate from/to input population.

Parameters
[in]popinput population.
Returns
the number of individuals to be migrated from/to the population according to the current migration rate and type.

Definition at line 75 of file migration/base.cpp.

std::string pagmo::migration::base::human_readable ( ) const

Return human readable representation.

Return a formatted string containing:

  • the name of the policy (in C++ mangled form),
  • migration type,
  • migration rate,
  • the output of human_readable_extra().
Returns
human readable representation of the policy.

Definition at line 102 of file migration/base.cpp.

std::string pagmo::migration::base::human_readable_extra ( ) const
protectedvirtual

Return extra information in human readable representation.

Return policy-specific information in human readable format. Default implementation returns an empty string.

Returns
empty string.

Definition at line 118 of file migration/base.cpp.

template<class ForwardIterator , class T >
static void pagmo::migration::base::iota ( ForwardIterator  first,
ForwardIterator  last,
value 
)
inlinestaticprotected

Iota function, usefull to fill iterator range with increasing values.

This function will fill the contents in the range [first,last) with increasing values, starting from *first = value.

Parameters
[in]firststart of the iterator range.
[in]lastend of the iterator range.
[in]valueinitial value.

Definition at line 88 of file migration/base.h.

Field Documentation

double pagmo::migration::base::m_rate
protected

Migration rate.

It will be interpreted as an integer in case of absolute rate migration type, as a floating-point value in case of fractional migration type.

Definition at line 98 of file migration/base.h.


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