GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Public Member Functions | List of all members
galib::internal::MigrationBuffer< GeneType > Class Template Referenceabstract

Interface for a thread-safe buffer that stores incoming migrants. More...

#include <MigrationBuffer.h>

Inheritance diagram for galib::internal::MigrationBuffer< GeneType >:
[legend]

Public Member Functions

virtual ~MigrationBuffer ()=default
 
virtual void push (std::vector< Individual< GeneType > > &&incoming_deme_batch)=0
 Adds a batch of individuals to the buffer.
 
virtual void popAll (std::vector< Individual< GeneType > > &target)=0
 Retrieves and removes all currently stored migrants.
 
virtual bool hasMigrants () const =0
 Checks if there are any migrants waiting in the buffer.
 

Detailed Description

template<typename GeneType>
class galib::internal::MigrationBuffer< GeneType >

Interface for a thread-safe buffer that stores incoming migrants.

Implementations must handle asynchronous arrivals from the network and allow the GA loop to retrieve them in batches.

Template Parameters
GeneTypeThe gene type of the individuals.

Definition at line 19 of file MigrationBuffer.h.

Constructor & Destructor Documentation

◆ ~MigrationBuffer()

template<typename GeneType >
virtual galib::internal::MigrationBuffer< GeneType >::~MigrationBuffer ( )
virtualdefault

Member Function Documentation

◆ hasMigrants()

template<typename GeneType >
virtual bool galib::internal::MigrationBuffer< GeneType >::hasMigrants ( ) const
pure virtual

Checks if there are any migrants waiting in the buffer.

Returns
True if migrants are available, false otherwise.

Implemented in galib::internal::CircularBuffer< GeneType >.

◆ popAll()

template<typename GeneType >
virtual void galib::internal::MigrationBuffer< GeneType >::popAll ( std::vector< Individual< GeneType > > &  target)
pure virtual

Retrieves and removes all currently stored migrants.

Parameters
targetVector where the migrants will be moved to.

Implemented in galib::internal::CircularBuffer< GeneType >.

◆ push()

template<typename GeneType >
virtual void galib::internal::MigrationBuffer< GeneType >::push ( std::vector< Individual< GeneType > > &&  incoming_deme_batch)
pure virtual

Adds a batch of individuals to the buffer.

Parameters
incoming_deme_batchThe individuals that arrived from another island.

Implemented in galib::internal::CircularBuffer< GeneType >.

Referenced by galib::internal::MpiCommunicator< GeneType >::update().


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