core/random.h

Go to the documentation of this file.
00001 
00008 #ifndef _RANDOM_H
00009 #define _RANDOM_H
00010 
00011 #include "platform.h"
00012 
00013 typedef enum {
00014     RT_INVALID=-1,  
00015     RT_DEGENERATE,  
00016     RT_UNIFORM,     
00017     RT_NORMAL,      
00018     RT_LOGNORMAL,   
00019     RT_BERNOULLI,   
00020     RT_PARETO,      
00021     RT_EXPONENTIAL, 
00022     RT_SAMPLED,     
00023 } RANDOMTYPE;
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028     int random_init(void);
00029     int random_test(void);
00030     double randunit(void);
00031     double random_degenerate(double a);
00032     double random_uniform(double a, double b);
00033     double random_normal(double m, double s);
00034     double random_bernoulli(double p);
00035     double random_sampled(unsigned int n, double *x);
00036     double random_pareto(double base, double gamma);
00037     double random_lognormal(double gmu, double gsigma);
00038     double random_exponential(double lambda);
00039     double random_functional(char *text);
00040     int random_apply(char *group_expression, char *property, RANDOMTYPE type, ...);
00041     RANDOMTYPE random_type(char *name);
00042     double random_value(RANDOMTYPE type, ...);
00043 #ifdef __cplusplus
00044 }
00045 #endif
00046 
00047 #endif
00048 

GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy