RandomUtil Class Reference
[Utils]

#include <RandomUtil.h>

Collaboration diagram for RandomUtil:

Collaboration graph
[legend]

List of all members.


Detailed Description

Implements a standard utility for getting random integer values, which can be replaced at runtime with a simulator/modelchecker version.

Definition at line 50 of file RandomUtil.h.


Static Public Member Functions

static void seedRandom (unsigned int s)
 seed the random number generator (a la srand48(int))
static unsigned randInt ()
static unsigned randInt (unsigned max)
 return a random integer between 0 and max
static unsigned randInt (unsigned max, unsigned first...)
 return a random integer between 0 and max with weights as given, one for each outcome
static unsigned vrandInt (unsigned max, unsigned first, va_list ap)
 return a random integer between 0 and max using a va_list for calling from other variable arg methods
static unsigned randInt (std::vector< unsigned > weights)
 return a random integer between 0 and weights.size(), each element being a weight
template<typename T>
static const T::key_type & random (const T &map)
 return a random element from a map, where the key is a random outcome, and the value is a weight

Member Function Documentation

static unsigned RandomUtil::randInt (  )  [inline, static]


The documentation for this class was generated from the following files:

Generated on Sat Oct 4 21:30:29 2008 for Mace Library by  doxygen 1.5.5