1 /* Copyright (c) 2019-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_XBT_RANDOM_HPP
7 #define SIMGRID_XBT_RANDOM_HPP
14 * @brief Tells xbt/random to use the ad-hoc distribution implementation.
16 void set_implem_xbt();
19 * @brief Tells xbt/random to use the standard library distribution implementation.
21 void set_implem_std();
24 * @brief Sets the seed of the Mersenne-Twister RNG
26 void set_mersenne_seed(int);
29 * @brief Draws an integer number uniformly in range [min, max] (min and max included)
31 * @param min Minimum value
32 * @param max Maximum value
34 int uniform_int(int min, int max);
37 * @brief Draws a real number uniformly in range [min, max) (min included, and max excluded)
39 * @param min Minimum value
40 * @param max Maximum value
42 double uniform_real(double min, double max);
45 * @brief Draws a real number according to the given exponential distribution
47 * @param lambda Parameter of the exponential law
49 double exponential(double lambda);
52 * @brief Draws a real number according to the given normal distribution
54 * @param mean Mean of the normal distribution
55 * @param sd Standard deviation of the normal distribution
57 double normal(double mean, double sd);
60 } // namespace simgrid