-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphFiles.h
More file actions
77 lines (60 loc) · 1.83 KB
/
Copy pathGraphFiles.h
File metadata and controls
77 lines (60 loc) · 1.83 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <vector>
#include <iostream>
using namespace std;
#ifndef GraphFiles_H
#define GraphFiles_H
/*
* This is a struct which holds the name, age, spreadProbability, daysOfInfection, diseaseProbability,
disease states: is_alive, is_infected, is_sick for every member of the population.
*/
struct Node {
string name;
int age;
float spreadProb;
int daysOfInfection;
float diseaseProb;
bool is_infected;
bool is_alive;
bool is_sick;
};
/*
* This is a struct Edge which holds information the connections of every member of the population has.
*/
struct Edge {
string first;
string second;
};
/*
* This is my graph class which forwards declares every fucntion used so that it can be easily accessed by other files.
*/
class Graph{
private:
int maxAge;
public:
vector<Node> popuNode;
Node node;
Edge edge;
vector<Edge>DiseaseProb;
vector<vector<string>> graph;
void print();
int getMaxAge();
void diseaseProb(Node &node);
void Recovered(Node &node);
void createEdge(ifstream &fileConnect);
int findNode(string name);
void addNode(ifstream &popFile);
void DayZero(vector<Node> &popuNode);
bool simulate_prob(float prob);
void printMembers();
int getRandomNumber (int maxValue);
void spreadInfection(vector<Node> &popuNode);
void simulation();
void printNode();
void nodeSick(Node &node);
void nodeRecovered (Node &node , vector<Node> &popuNode);
void nodeNeighbours (vector<Node> &popuNode);
void nodeDead(Node &node);
void nodeDaysInfection(Node &node);
void popuSummary();
};
#endif