ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
generation_engine Class Referencefinal

Random generation engine with seed-controlled repeatability. More...

#include <generation_engine.hpp>

Collaboration diagram for generation_engine:
Collaboration graph

Public Member Functions

 generation_engine (std::uint64_t seed)
 Constructs an engine with a specific seed.
 
 generation_engine ()
 Constructs an engine with a random seed.
 
std::uint64_t seed () const
 Returns the seed used for this engine.
 
int random_int (int min, int max)
 Generates a random integer in [min, max].
 
bool random_bool (double probability=0.5)
 Generates a random boolean with specified probability of true.
 
template<typename T >
const T & pick (const std::vector< T > &items)
 Picks a random element from a vector.
 
template<typename T , std::size_t N>
const T & pick (const std::array< T, N > &items)
 Picks a random element from an array.
 
boost::uuids::uuid generate_uuid ()
 Generates a UUID v7 based on the engine's random state.
 
std::chrono::system_clock::time_point past_timepoint (int years_back=3)
 Generates a random timestamp within the past N years.
 
std::string alphanumeric (std::size_t length)
 Generates an alphanumeric string of specified length.
 

Detailed Description

Random generation engine with seed-controlled repeatability.

Provides UUID v7 generation, random integers, booleans, element picking, timestamps, and alphanumeric strings. All random values are derived from a single mt19937_64 engine seeded at construction.