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

Context for controlling synthetic data generation. More...

#include <generation_context.hpp>

Collaboration diagram for generation_context:
Collaboration graph

Public Member Functions

 generation_context (std::uint64_t seed)
 Constructs a generation context with a specific seed.
 
 generation_context ()
 Constructs a generation context with a random seed.
 
std::uint64_t seed () const
 Returns the seed used for this context.
 
int random_int (int min, int max)
 Generates a random integer in the specified range.
 
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 context'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

Context for controlling synthetic data generation.

This class provides controlled random generation with a configurable seed to ensure repeatable results. All random values should be generated through this context to maintain consistency.

Constructor & Destructor Documentation

◆ generation_context()

generation_context ( std::uint64_t  seed)
explicit

Constructs a generation context with a specific seed.

Parameters
seedThe seed for the random number generator.