-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom.cpp
More file actions
31 lines (25 loc) · 745 Bytes
/
Copy pathrandom.cpp
File metadata and controls
31 lines (25 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<bits/stdc++.h>
#include<random>
#include "global.h"
using namespace std;
//Función que asigna semilla al generador aleatoreos
void randomize(int seed){
rng.seed(seed);
}
//Función que retorna un numero entero entre a y b incluyentes
int getRandomInt(int a, int b) {
// cout << "VOY A LLORAR " << endl;
uniform_int_distribution<int> dist(a, b);
// cout << "NO llore" << endl;
return dist(rng);
}
//Funcion que retorna un numero real entre 0 y 1
float getRandomProb(){
uniform_real_distribution<float> dist(0.0f, 1.0f);
return dist(rng);
}
//Funcion que retorna un numero real entre 0 y lim
float getRandomProb_lim(float lim){
uniform_real_distribution<float> dist(0.0f, lim);
return dist(rng);
}