-
Notifications
You must be signed in to change notification settings - Fork 0
/
simulations.hpp
54 lines (46 loc) · 1.05 KB
/
simulations.hpp
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __SIMULATIONS__HPP
#define __SIMULATIONS__HPP
#include <vector>
#include <string>
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <stdexcept>
#include <stdio.h>
#include <list>
#include <queue>
#include <fstream>
using namespace std;
struct Node{
int key;
vector<Node *> sons;
};
class Simulations{
private:
vector<Node *> roots;
vector<int> population;
vector<int> count;
vector<int> final_population;
vector<int> final_count;
void doing_nodes(vector<int> p);
void create_count();
void display(Node *root);
public:
Simulations(){}
~Simulations(){destroy(roots);};
void set_population(const vector<int> nw);
vector<int> get_population();
void nodes() {doing_nodes(population);}
void print_nodes();
void do_simulation();//Number o iterations
void doing_simulations(int k);
void create_sons(int n, int s, vector<Node *> r);
void display_tree();
bool only_one_element(vector<int> p);
void create_txt();
void destroy(vector<Node *> p);
void create_txtcount();
};
#endif
//