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

A topology where islands are connected in a unidirectional circle. More...

#include <OneWayRingTopology.h>

Inheritance diagram for galib::OneWayRingTopology:
[legend]

Public Member Functions

 OneWayRingTopology (const std::size_t num_nodes)
 Constructs a unidirectional ring topology for num_nodes nodes.
 
internal::NodeLinks getLinks (const std::size_t node) const override
 Returns the next node as output and previous node as input.
 
- Public Member Functions inherited from galib::Topology
virtual ~Topology ()=default
 
 Topology (const std::size_t num_nodes)
 Constructs a topology for a specific number of nodes.
 

Additional Inherited Members

- Protected Member Functions inherited from galib::Topology
std::size_t getNumNodes () const
 Returns the total number of nodes in the topology.
 

Detailed Description

A topology where islands are connected in a unidirectional circle.

Low connectivity that helps preserve population diversity by slowing down the spread of elite individuals.

Definition at line 16 of file OneWayRingTopology.h.

Constructor & Destructor Documentation

◆ OneWayRingTopology()

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

Constructs a unidirectional ring topology for num_nodes nodes.

Definition at line 19 of file OneWayRingTopology.h.

Member Function Documentation

◆ getLinks()

internal::NodeLinks galib::OneWayRingTopology::getLinks ( const std::size_t  node) const
inlineoverridevirtual

Returns the next node as output and previous node as input.

Parameters
nodeLocal node ID.
Returns
Neighbors in a one-way ring.

Implements galib::Topology.

Definition at line 26 of file OneWayRingTopology.h.

References galib::Topology::getNumNodes().


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