0.3.0
Loading...
Searching...
No Matches
RandomNumberGenerator.cpp
Go to the documentation of this file.
1/// This file is part of INSTINCT, the INS Toolkit for Integrated
2/// Navigation Concepts and Training by the Institute of Navigation of
3/// the University of Stuttgart, Germany.
4///
5/// This Source Code Form is subject to the terms of the Mozilla Public
6/// License, v. 2.0. If a copy of the MPL was not distributed with this
7/// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file RandomNumberGenerator.cpp
10/// @brief Random Number generator
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2023-08-24
13
15
16namespace NAV
17{
18
20{
21 j = json{
22 { "useSeed", rng.useSeed },
23 { "seed", rng.seed },
24 };
25}
27{
28 if (j.contains("useSeed"))
29 {
30 j.at("useSeed").get_to(rng.useSeed);
31 }
32 if (j.contains("seed"))
33 {
34 j.at("seed").get_to(rng.seed);
35 }
36}
37
38} // namespace NAV
nlohmann::json json
json namespace
Random Number Generator.
Manages a thread which calls a specified function at a specified interval.
uint64_t seed
Seed for the random number generator.
bool useSeed
Flag whether to use the seed instead of the system time.
void to_json(json &j, const Node &node)
Converts the provided node into a json object.
Definition Node.cpp:990
void from_json(const json &j, Node &node)
Converts the provided json object into a node object.
Definition Node.cpp:1007