Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add surf_cpu_init_im_bypass to be used to bypass the parser without passing through...
[simgrid.git] / src / include / surf / random_mgr.h
1 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5   * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SURF_RMGR_H
8 #define _SURF_RMGR_H
9
10 #include "xbt/heap.h"
11 #include "xbt/dict.h"
12 #include <stdlib.h>
13 #include <math.h>
14
15 SG_BEGIN_DECL()
16
17      typedef enum { NONE, DRAND48, RAND } Generator;
18
19      typedef struct random_data_desc {
20        long int seed;
21        double max, min;
22        double mean, std;        /* note: mean and standard deviation are normalized */
23        Generator generator;
24      } s_random_data_t, *random_data_t;
25
26 XBT_PUBLIC_DATA(xbt_dict_t) random_data_list;
27
28 XBT_PUBLIC(double) random_generate(random_data_t random);
29 XBT_PUBLIC(random_data_t) random_new(Generator generator, long int seed,
30                                      double min, double max, double mean,
31                                      double stdDeviation);
32
33 SG_END_DECL()
34 #endif /* _SURF_RMGR_H */