hops
DNest4EnvironmentSingleton.hpp
Go to the documentation of this file.
1 #ifndef HOPS_DNEST4ENVIRONMENTSINGLETON_HPP
2 #define HOPS_DNEST4ENVIRONMENTSINGLETON_HPP
3 
5 
6 namespace hops {
8  public:
9  using StateType = Model::StateType;
10 
12  static DNest4EnvironmentSingleton instance;
13  return instance;
14  }
15 
16  [[nodiscard]] static bool isRngInitialized() const {
17  return rngInitialized;
18  }
19 
21  return rng;
22  }
23 
24  static const hops::MarkovChain *getSampler() const {
25  return sampler.get();
26  }
27 
28  static const Model *getModel() const {
29  return model.get();
30  }
31 
32  DNest4EnvironmentSingleton(const DNest4ModelSingleton &) = delete;
33 
34  DNest4EnvironmentSingleton &operator=(const DNest4ModelSingleton &) = delete;
35 
36  private:
37  static std::unique_ptr<hops::MarkovChain> sampler;
38  static std::unique_ptr<hops::Model> model;
39 
40  static bool rngInitialized = false;
41  static hops::RandomNumberGenerator rng;
42 
43  DNest4EnvironmentSingleton() = default;
44 
45  ~DNest4EnvironmentSingleton() = default;
46  };
47 }
48 
49 #endif //HOPS_DNEST4ENVIRONMENTSINGLETON_HPP
hops::DNest4EnvironmentSingleton::operator=
DNest4EnvironmentSingleton & operator=(const DNest4ModelSingleton &)=delete
hops::DNest4EnvironmentSingleton::getRandomNumberGenerator
static hops::RandomNumberGenerator & getRandomNumberGenerator()
Definition: DNest4EnvironmentSingleton.hpp:20
pcg_detail::engine
Definition: pcg_random.hpp:364
hops
Definition: CsvReader.hpp:8
hops::DNest4EnvironmentSingleton::getInstance
static DNest4EnvironmentSingleton & getInstance()
Definition: DNest4EnvironmentSingleton.hpp:11
hops::MarkovChainInterface
Definition: MarkovChain.hpp:17
MarkovChain.hpp
hops::DNest4EnvironmentSingleton::getSampler
static const hops::MarkovChain * getSampler() const
Definition: DNest4EnvironmentSingleton.hpp:24
hops::DNest4EnvironmentSingleton
Definition: DNest4EnvironmentSingleton.hpp:7
hops::Model
Definition: Model.hpp:12
hops::DNest4EnvironmentSingleton::StateType
Model::StateType StateType
Definition: DNest4EnvironmentSingleton.hpp:9
hops::DNest4EnvironmentSingleton::isRngInitialized
static bool isRngInitialized() const
Definition: DNest4EnvironmentSingleton.hpp:16
hops::DNest4EnvironmentSingleton::getModel
static const Model * getModel() const
Definition: DNest4EnvironmentSingleton.hpp:28