FastMM documentation
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::AbPlan Class Reference

#include <fastmm/strategies/ab_test.hpp>

Public Member Functions

 AbPlan (const AbSection &section, const InstrumentTable &instruments, std::span< const std::string > venue_names)
 venue_names name the venue ids of instruments (Config::venues order), for [ab.weights] keys written "venue:symbol".
 
const AbSection & section () const noexcept
 
AbAssignment assignment () const noexcept
 
std::size_t arms () const noexcept
 
std::size_t instruments () const noexcept
 
const std::string & arm_name (int arm) const
 
const std::string & instrument_name (std::size_t inst) const
 The instrument's name in the configuration's terms: "venue:symbol".
 
std::int64_t start_ns () const noexcept
 INT64_MIN: none.
 
std::int64_t end_ns () const noexcept
 INT64_MAX: none.
 
std::int64_t block_ns () const noexcept
 0: no blocks
 
std::int64_t block_end (std::int64_t k) const noexcept
 When block k ends (time, crossover).
 
bool in_test (std::size_t inst) const noexcept
 The instrument is in the test: [ab.assign] names it, or there is none.
 
void set_branch (int arm) noexcept
 branch: the arm of this run, and the start when [ab] start names none.
 
int branch () const noexcept
 
void set_default_start (std::int64_t ns) noexcept
 
int arm_at (std::size_t inst, std::int64_t t) const noexcept
 The arm instrument inst is in at t (ns since the epoch): kNoArm before start and from end.
 
std::int64_t next_change (std::int64_t t) const noexcept
 The first time after t at which arm_at() may change, INT64_MAX when it never does.
 
std::int64_t block_of (std::int64_t t) const noexcept
 The block t falls in (time, crossover), 0 with instrument.
 
std::int64_t round_of (std::int64_t t) const noexcept
 The run of arms() blocks t falls in, each arm once in it (time, crossover); 0 with instrument.
 
std::size_t stratum (std::size_t inst) const noexcept
 The instrument's stratum (instrument, crossover; 0 with time) and its slot in it.
 
std::size_t slot (std::size_t inst) const noexcept
 
bool identical_arms () const noexcept
 Every arm names the same parameters with the same values: an A/A test.
 

Static Public Attributes

static constexpr int kNoArm = -1
 

Constructor & Destructor Documentation

◆ AbPlan()

fastmm::AbPlan::AbPlan ( const AbSection &  section,
const InstrumentTable &  instruments,
std::span< const std::string >  venue_names 
)

venue_names name the venue ids of instruments (Config::venues order), for [ab.weights] keys written "venue:symbol".

Throws ConfigError for a weight naming no instrument or an instrument with no weight (when there are weights), and for an instrument or crossover split over fewer instruments than arms.

Member Function Documentation

◆ section()

const AbSection & fastmm::AbPlan::section ( ) const
inlinenoexcept

◆ assignment()

AbAssignment fastmm::AbPlan::assignment ( ) const
inlinenoexcept

◆ arms()

std::size_t fastmm::AbPlan::arms ( ) const
inlinenoexcept

◆ instruments()

std::size_t fastmm::AbPlan::instruments ( ) const
inlinenoexcept

◆ arm_name()

const std::string & fastmm::AbPlan::arm_name ( int  arm) const
inline

◆ instrument_name()

const std::string & fastmm::AbPlan::instrument_name ( std::size_t  inst) const
inline

The instrument's name in the configuration's terms: "venue:symbol".

◆ start_ns()

std::int64_t fastmm::AbPlan::start_ns ( ) const
inlinenoexcept

INT64_MIN: none.

◆ end_ns()

std::int64_t fastmm::AbPlan::end_ns ( ) const
inlinenoexcept

INT64_MAX: none.

◆ block_ns()

std::int64_t fastmm::AbPlan::block_ns ( ) const
inlinenoexcept

0: no blocks

◆ block_end()

std::int64_t fastmm::AbPlan::block_end ( std::int64_t  k) const
inlinenoexcept

When block k ends (time, crossover).

◆ in_test()

bool fastmm::AbPlan::in_test ( std::size_t  inst) const
inlinenoexcept

The instrument is in the test: [ab.assign] names it, or there is none.

◆ set_branch()

void fastmm::AbPlan::set_branch ( int  arm)
inlinenoexcept

branch: the arm of this run, and the start when [ab] start names none.

◆ branch()

int fastmm::AbPlan::branch ( ) const
inlinenoexcept

◆ set_default_start()

void fastmm::AbPlan::set_default_start ( std::int64_t  ns)
inlinenoexcept

◆ arm_at()

int fastmm::AbPlan::arm_at ( std::size_t  inst,
std::int64_t  t 
) const
noexcept

The arm instrument inst is in at t (ns since the epoch): kNoArm before start and from end.

◆ next_change()

std::int64_t fastmm::AbPlan::next_change ( std::int64_t  t) const
noexcept

The first time after t at which arm_at() may change, INT64_MAX when it never does.

◆ block_of()

std::int64_t fastmm::AbPlan::block_of ( std::int64_t  t) const
noexcept

The block t falls in (time, crossover), 0 with instrument.

◆ round_of()

std::int64_t fastmm::AbPlan::round_of ( std::int64_t  t) const
noexcept

The run of arms() blocks t falls in, each arm once in it (time, crossover); 0 with instrument.

◆ stratum()

std::size_t fastmm::AbPlan::stratum ( std::size_t  inst) const
inlinenoexcept

The instrument's stratum (instrument, crossover; 0 with time) and its slot in it.

◆ slot()

std::size_t fastmm::AbPlan::slot ( std::size_t  inst) const
inlinenoexcept

◆ identical_arms()

bool fastmm::AbPlan::identical_arms ( ) const
noexcept

Every arm names the same parameters with the same values: an A/A test.

Member Data Documentation

◆ kNoArm

constexpr int fastmm::AbPlan::kNoArm = -1
staticconstexpr