Class Chooser

Class Documentation

class Chooser

the simulation of choice(), success and failure

Public Functions

int choice(int k)

choice( { 0 , … , k - 1 } )

Pre:

k >= 1

Post:

the result is in [ 0 , k )

template<class A>
bool run(A &&alg, long *runs = nullptr)

whether some sequence of choices makes alg( *this ) return true; the runs made go to *runs, if given

std::vector<int> choices(void) const

the choices of the last run, the successful one after a YES