SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
Functions
Random.h File Reference
#include <chrono>
#include <random>
#include <algorithm>
#include <iterator>
#include <stdlib.h>
#include "common/Thread.h"
Include dependency graph for Random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::default_random_engine & ai::randomEngine ()
 
void ai::randomSeed (unsigned int seed)
 
float ai::randomf (float max=1.0f)
 
int ai::random (int min, int max)
 
float ai::randomBinomial (float max=1.0f)
 
template<typename I >
ai::randomElement (I begin, I end)
 
template<typename T >
void ai::randomElements (std::vector< T > &vec, int n)
 Helper function to cut the input vector down to n random elements.
 
template<typename I >
void ai::shuffle (I begin, I end)