PaGMO  1.1.5
Public Member Functions | Friends
pagmo::island Class Reference

Local island class. More...

#include <island.h>

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

Public Member Functions

 island (const island &)
 Copy constructor. More...
 
 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...
 
 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...
 
islandoperator= (const island &)
 Assignment operator.
 
base_island_ptr clone () const
 Clone method. More...
 
Input/output.
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

Evolution.

Methods related to island evolution.

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 island *, const unsigned int)
 
template<class Archive >
void boost::serialization::load_construct_data (Archive &, 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

Local island class.

This island class will launch evolutions using local threads.

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 68 of file island.h.

Constructor & Destructor Documentation

pagmo::island::island ( const island isl)

Copy constructor.

See also
pagmo::base_island constructors.

Definition at line 51 of file island.cpp.

pagmo::island::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 42 of file island.cpp.

pagmo::island::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 58 of file island.cpp.

Member Function Documentation

base_island_ptr pagmo::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 70 of file island.cpp.

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

Return a string identifying the island's type.

Default implementation will return the island's C++ mangled name.

Returns
a string identifying the island's type.

Reimplemented from pagmo::base_island.

Definition at line 80 of file island.cpp.


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