Randomly draws items from a given set, based on given probability densities. Uses RandomNumberGenerator internally, see RandomNumberGenerator for parametrization of seed and algorithms.
More...
#include <RandomDraw.hpp>
Randomly draws items from a given set, based on given probability densities. Uses RandomNumberGenerator internally, see RandomNumberGenerator for parametrization of seed and algorithms.
- See also
- RandomNumberGenerator
◆ RandomDraw()
| graph_analysis::percolation::strategies::RandomDraw::RandomDraw |
( |
uint32_t |
seed = 0 | ) |
|
- Parameters
-
| seed | If set to 0 will use a random seed, otherwise argument is passed as seed to srand() |
◆ ~RandomDraw()
| graph_analysis::percolation::strategies::RandomDraw::~RandomDraw |
( |
| ) |
|
◆ drawItem()
| GraphElementId graph_analysis::percolation::strategies::RandomDraw::drawItem |
( |
| ) |
const |
Draw an item from the known set of elements
- Returns
- id of the drawn item
◆ getProbability()
| double graph_analysis::percolation::strategies::RandomDraw::getProbability |
( |
GraphElementId |
id | ) |
const |
Get the probability for drawing the given element
- Returns
- probability for drawing the element
◆ getProbabilityDensitySum()
| double graph_analysis::percolation::strategies::RandomDraw::getProbabilityDensitySum |
( |
| ) |
const |
Get probability density
- Returns
- the overall sum of probability densities
◆ removeItem()
| void graph_analysis::percolation::strategies::RandomDraw::removeItem |
( |
GraphElementId |
id | ) |
|
◆ setProbabilityDensity()
| void graph_analysis::percolation::strategies::RandomDraw::setProbabilityDensity |
( |
GraphElementId |
id, |
|
|
double |
density |
|
) |
| |
Set probability density
- Parameters
-
| id | GraphElementId for which the density should be set |
| density | Density for the element id |
The documentation for this class was generated from the following files:
- /build/rock-master-22.06-tools-graph-analysis-0.20210908/src/percolation/strategies/RandomDraw.hpp
- /build/rock-master-22.06-tools-graph-analysis-0.20210908/src/percolation/strategies/RandomDraw.cpp