PaGMO  1.1.5
Public Member Functions | Protected Member Functions | Friends
pagmo::mpi_island Class Reference

MPI island class. More...

#include <mpi_island.h>

Inheritance diagram for pagmo::mpi_island:
Inheritance graph
[legend]

Public Member Functions

 mpi_island (const mpi_island &)
 Copy constructor. More...
 
 mpi_island (const algorithm::base &, const problem::base &, int=0, const migration::base_s_policy &=migration::best_s_policy(), const migration::base_r_policy &=migration::fair_r_policy())
 Constructor from problem::base, algorithm::base, number of individuals, migration probability and selection/replacement policies. More...
 
 mpi_island (const algorithm::base &, const population &, const migration::base_s_policy &=migration::best_s_policy(), const migration::base_r_policy &=migration::fair_r_policy())
 Constructor from population. More...
 
mpi_islandoperator= (const mpi_island &)
 Assignment operator.
 
base_island_ptr clone () const
 Clone method. More...
 
std::string get_name () const
 Return a string identifying the island's type. More...
 
- Public Member Functions inherited from pagmo::base_island
 base_island (const base_island &)
 Copy constructor. More...
 
 base_island (const algorithm::base &, const problem::base &, int, const migration::base_s_policy &, const migration::base_r_policy &)
 Constructor from problem::base, algorithm::base, number of individuals, migration probability and selection/replacement policies. More...
 
 base_island (const algorithm::base &, const population &, const migration::base_s_policy &, const migration::base_r_policy &)
 Constructor from population. More...
 
base_islandoperator= (const base_island &)
 Assignment operator. More...
 
virtual ~base_island ()
 Destructor. More...
 
std::string human_readable_terse () const
 Return terse human readable representation of the island. More...
 
std::string human_readable () const
 Return human readable representation of the island. More...
 
algorithm::base_ptr get_algorithm () const
 Return copy of the internal algorithm. More...
 
void set_algorithm (const algorithm::base &)
 Algorithm setter. More...
 
void set_x (population::size_type, const decision_vector &)
 Sets a decision vector. More...
 
void set_v (population::size_type, const decision_vector &)
 Sets a velocity vector. More...
 
problem::base_ptr get_problem () const
 Return copy of the internal problem. More...
 
population::size_type get_size () const
 Size of the internal population. More...
 
migration::base_s_policy_ptr get_s_policy () const
 Get a copy of the selection policy. More...
 
migration::base_r_policy_ptr get_r_policy () const
 Get a copy of the replacement policy. More...
 
population get_population () const
 Get a copy of the internal population. More...
 
void set_population (const population &)
 Set internal population. More...
 
virtual void join () const
 Join island. More...
 
bool busy () const
 Query the status of the island. More...
 
void evolve (int=1)
 Evolve island n times. More...
 
void evolve_t (int)
 Evolve island for a specified minimum amount of time. More...
 
void interrupt ()
 Interrupt evolution. More...
 
std::size_t get_evolution_time () const
 Return the total evolution time in milliseconds. More...
 

Protected Member Functions

void perform_evolution (const algorithm::base &, population &) const
 Method that implements the evolution of the population.
 
- Protected Member Functions inherited from pagmo::base_island
virtual void thread_entry ()
 Thread entry hook. More...
 
virtual void thread_exit ()
 Thread exit hook. More...
 

Friends

class boost::serialization::access
 
template<class Archive >
void boost::serialization::save_construct_data (Archive &, const pagmo::mpi_island *, const unsigned int)
 
template<class Archive >
void boost::serialization::load_construct_data (Archive &, pagmo::mpi_island *, const unsigned int)
 

Additional Inherited Members

- Protected Attributes inherited from pagmo::base_island
algorithm::base_ptr m_algo
 Algorithm.
 
population m_pop
 Population.
 
archipelagom_archi
 Pointer that, if not null, points to the archipelago containing the island.
 
std::size_t m_evo_time
 Total time spent by the island on evolution (in milliseconds).
 
migration::base_s_policy_ptr m_s_policy
 Migration selection policy.
 
migration::base_r_policy_ptr m_r_policy
 Migration replacement policy.
 
boost::scoped_ptr< boost::thread > m_evo_thread
 Evolution thread.
 

Detailed Description

MPI island class.

This island class will dispatch evolutions to participants to an MPI cluster. This class can be used like any other island class, the only difference being that before calling any evolution a pagmo::mpi_environment instance must have been created. More information about the MPI support in PaGMO is available in this page.

NOTE: this class is available only if PaGMO was compiled with MPI support.

Author
Francesco Biscani (blues.nosp@m.carn.nosp@m.i@gma.nosp@m.il.c.nosp@m.om)
Dante Stroe (dante.nosp@m..str.nosp@m.oe@gm.nosp@m.ail..nosp@m.com)

Definition at line 77 of file mpi_island.h.

Constructor & Destructor Documentation

pagmo::mpi_island::mpi_island ( const mpi_island isl)

Copy constructor.

See also
pagmo::base_island constructors.

Definition at line 78 of file mpi_island.cpp.

pagmo::mpi_island::mpi_island ( const algorithm::base a,
const problem::base p,
int  n = 0,
const migration::base_s_policy s_policy = migration::best_s_policy(),
const migration::base_r_policy r_policy = migration::fair_r_policy() 
)
explicit

Constructor from problem::base, algorithm::base, number of individuals, migration probability and selection/replacement policies.

See also
pagmo::base_island constructors.

Definition at line 60 of file mpi_island.cpp.

pagmo::mpi_island::mpi_island ( const algorithm::base a,
const population pop,
const migration::base_s_policy s_policy = migration::best_s_policy(),
const migration::base_r_policy r_policy = migration::fair_r_policy() 
)
explicit

Constructor from population.

See also
pagmo::base_island constructors.

Definition at line 69 of file mpi_island.cpp.

Member Function Documentation

base_island_ptr pagmo::mpi_island::clone ( ) const
virtual

Clone method.

Provided that the derived island implements properly the copy constructor, virtually all implementations of this method will look like this:

return base_ptr(new derived_island(*this));
Returns
pagmo::base_island_ptr to a copy of this.

Implements pagmo::base_island.

Definition at line 88 of file mpi_island.cpp.

std::string pagmo::mpi_island::get_name ( ) const
virtual

Return a string identifying the island's type.

Returns
the string "MPI island".

Reimplemented from pagmo::base_island.

Definition at line 143 of file mpi_island.cpp.


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