BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
RandomDistributionFactory.h
Go to the documentation of this file.
1#ifndef BPMNOS_Model_RandomDistributionFactory_H
2#define BPMNOS_Model_RandomDistributionFactory_H
3
4#include <string>
5#include <random>
6#include <map>
7#include <functional>
8#include <nlohmann/json.hpp>
9
10namespace BPMNOS {
11
12using RandomGenerator = std::mt19937;
13using RandomDistribution = std::function<double(RandomGenerator &)>;
14
15template <class DistributionType, class... Parameters>
16RandomDistribution make_distribution_impl(nlohmann::json const &input, Parameters... parameters) {
17 return DistributionType{input.at(parameters)...};
18}
19
20RandomDistribution make_distribution(const std::string& jsonString);
21RandomDistribution make_distribution(const nlohmann::json& input);
22
23} // namespace BPMNOS
24
25#endif // BPMNOS_Model_RandomDistributionFactory_H
std::mt19937 RandomGenerator
std::function< double(RandomGenerator &)> RandomDistribution
RandomDistribution make_distribution(const std::string &jsonString)
RandomDistribution make_distribution_impl(nlohmann::json const &input, Parameters... parameters)