embedded system library for e-puck  1.0.1
A redesigned API library for the e-puck robot platform
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
el_random.h
Go to the documentation of this file.
1 /*
2 
3 embedded system library for e-puck
4 
5 --------------------------------------------------------------------------------
6 
7 code distribution:
8 https://github.com/jianingchen/epucklib
9 
10 online documentation:
11 http://jianingchen.github.io/epucklib/html/
12 
13 --------------------------------------------------------------------------------
14 
15 This file is released under the terms of the MIT license (see "el.h").
16 
17 */
18 
42 #ifndef EL_RANDOM_H
43 #define EL_RANDOM_H
44 
45 #include "el_common.h"
46 
56 void el_random_set_seed(int seed);
57 
58 
63 void el_random_reset_seed(void);
64 
65 
71 el_uint16 el_random_get_seed(void);
72 
73 
79 el_uint16 el_random_uint16(void);
80 
81 
87 el_uint32 el_random_uint32(void);
88 
89 
95 el_int16 el_random_int(el_int16 min,el_int16 max);
96 
97 
122 el_bool el_random_rate(el_uint16 num,el_uint16 den);
123 
124 #endif
void el_random_set_seed(int seed)
set seed of the random generator module
el_uint16 el_random_get_seed(void)
get seed of the current random sequence
void el_random_reset_seed(void)
reset the random seed to default value
el_int16 el_random_int(el_int16 min, el_int16 max)
returning a random int in [min,max]
el_uint32 el_random_uint32(void)
returning a random unsigned long int in [0,2^32 - 1]
el_uint16 el_random_uint16(void)
returning a random unsigned short int in [0,65535]
el_bool el_random_rate(el_uint16 num, el_uint16 den)
returning true at a probability of (num/den)