Antkeeper  0.0.1
Public Member Functions | Public Attributes | List of all members
ant_gene_frequency_table< T > Struct Template Reference

Ant gene frequency table. More...

#include <ant-gene-frequency-table.hpp>

Public Member Functions

template<class URBG >
std::shared_ptr< T > sample (URBG &urbg) const
 Samples a gene from the frequency table. More...
 

Public Attributes

std::vector< std::shared_ptr< T > > genes
 Gene array. More...
 
std::vector< float > weights
 Weight array. More...
 

Detailed Description

template<class T>
struct ant_gene_frequency_table< T >

Ant gene frequency table.

Template Parameters
TGene type.

Definition at line 33 of file ant-gene-frequency-table.hpp.

Member Function Documentation

◆ sample()

template<class T >
template<class URBG >
std::shared_ptr<T> ant_gene_frequency_table< T >::sample ( URBG &  urbg) const
inline

Samples a gene from the frequency table.

Template Parameters
URBGUniform random bit generator type.
Parameters
urbgUniform random bit generator object.
Returns
Randomly sampled gene.

Definition at line 51 of file ant-gene-frequency-table.hpp.

Member Data Documentation

◆ genes

template<class T >
std::vector<std::shared_ptr<T> > ant_gene_frequency_table< T >::genes

Gene array.

Definition at line 36 of file ant-gene-frequency-table.hpp.

◆ weights

template<class T >
std::vector<float> ant_gene_frequency_table< T >::weights

Weight array.

Definition at line 39 of file ant-gene-frequency-table.hpp.


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