GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
galib::Topology Class Referenceabstract

Abstract base class for archipelago topologies. More...

#include <Topology.h>

Inheritance diagram for galib::Topology:
[legend]

Public Member Functions

virtual ~Topology ()=default
 
 Topology (const std::size_t num_nodes)
 Constructs a topology for a specific number of nodes.
 
virtual internal::NodeLinks getLinks (std::size_t node) const =0
 Determines the neighbors for a specific island rank.
 

Protected Member Functions

std::size_t getNumNodes () const
 Returns the total number of nodes in the topology.
 

Detailed Description

Abstract base class for archipelago topologies.

Defines the logical connectivity between islands in a distributed parallel GA.

Definition at line 28 of file Topology.h.

Constructor & Destructor Documentation

◆ ~Topology()

virtual galib::Topology::~Topology ( )
virtualdefault

◆ Topology()

galib::Topology::Topology ( const std::size_t  num_nodes)
inlineexplicit

Constructs a topology for a specific number of nodes.

Parameters
num_nodesTotal islands in the archipelago. Must be >= 2.
Exceptions
std::invalid_argumentif num_nodes < 2.

Definition at line 44 of file Topology.h.

Member Function Documentation

◆ getLinks()

virtual internal::NodeLinks galib::Topology::getLinks ( std::size_t  node) const
pure virtual

Determines the neighbors for a specific island rank.

Parameters
nodeThe rank/ID of the local island.
Returns
Structure containing input and output neighbor lists.

Implemented in galib::BidirectionalRingTopology, galib::FullyConnectedTopology, and galib::OneWayRingTopology.

◆ getNumNodes()

std::size_t galib::Topology::getNumNodes ( ) const
inlineprotected

Returns the total number of nodes in the topology.

Definition at line 34 of file Topology.h.

Referenced by galib::BidirectionalRingTopology::getLinks(), galib::FullyConnectedTopology::getLinks(), and galib::OneWayRingTopology::getLinks().


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