21 template <
typename GeneType>
55 const std::vector<std::size_t>& destination_ranks) = 0;
69 [[nodiscard]]
virtual std::size_t
getRank()
const = 0;
75 [[nodiscard]]
virtual std::size_t
getSize()
const = 0;
Represents a single candidate solution in the population.
Interface for network communication between islands.
virtual void broadcast(const std::vector< Individual< GeneType > > &deme, const std::vector< std::size_t > &destination_ranks)=0
Sends a deme to multiple destination islands.
virtual std::size_t getSize() const =0
Gets the total number of islands in the network.
virtual ~Communicator()=default
virtual void update()=0
Processes any pending network events (e.g. polls for incoming messages).
virtual Individual< GeneType > allReduceBest(Individual< GeneType > individual) const =0
Global reduction to find the best individual across all islands.
virtual void startReceiving(MigrationBuffer< GeneType > &target_buffer)=0
Begins asynchronous background receiving of migrants.
virtual std::size_t getRank() const =0
Gets the network rank of the local node.
virtual void send(const std::vector< Individual< GeneType > > &deme, std::size_t destination_rank)=0
Sends a deme to a specific destination island.
virtual void stopReceiving()=0
Stops background communication activities.
Interface for a thread-safe buffer that stores incoming migrants.