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();
18 * @brief Tells xbt/random to use the standard library distribution implementation.
20 void set_implem_std();
22 * @brief Sets the seed of the Mersenne-Twister RNG
24 void set_mersenne_seed(int);
27 * @brief Draws an integer number uniformly between min and max included
29 * @param min Minimum value
30 * @param max Maximum value
32 int uniform_int(int min, int max);
34 * @brief Draws a real number uniformly between min and max included
36 * @param min Minimum value
37 * @param max Maximum value
39 double uniform_real(double min, double max);
41 * @brief Draws a real number according to the given exponential distribution
43 * @param lambda Parameter of the exponential law
45 double exponential(double lambda);
47 * @brief Draws a real number according to the given normal distribution
49 * @param mean Mean of the normal distribution
50 * @param sd Standard deviation of the normal distribution
52 double normal(double mean, double sd);
55 } // namespace simgrid