VPTissue Reference Manual
RandomEngineType.h
Go to the documentation of this file.
1 #ifndef RANDOM_ENGINE_TYPE_H_INCLUDED
2 #define RANDOM_ENGINE_TYPE_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <string>
23 
24 namespace SimPT_Sim {
25 namespace RandomEngineType {
26 
28 struct Info
29 {
30  Info() : seed(0), state(""), type("") {};
31  unsigned int seed;
32  std::string state;
33  std::string type;
34 
35 };
36 
38 enum class TypeId {
39  // We are using a sensible subset of engines provided by the trng library
40  lcg64, lcg64_shift, mrg2, mrg3, yarn2, yarn3
41 
42  // Before using Tina's RNG std C++ random engines were used. They are
43  // listed here in comment as a reference:
44  // minstd_rand0, minstd_rand, mt19937, mt19937_64, ranlux24_base,
45  // ranlux48_base, knuth_b
46 };
47 
49 bool IsExisting(std::string s);
50 
52 bool IsExisting(TypeId b);
53 
55 std::string ToString(TypeId b);
56 
58 TypeId FromString(std::string s);
59 
60 } // namespace
61 } // namespace
62 
63 #endif // end-of-include-guard
string ToString(TypeId b)
Convert a type id to corresponding name.
TypeId FromString(string s)
Convert a string with name to type id.
Namespace for the core simulator.
TypeId
Enumerates type ids.
bool IsExisting(std::string s)
Check whether type with name s exists.