-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTesteMedidas.cpp
More file actions
137 lines (130 loc) · 4.32 KB
/
TesteMedidas.cpp
File metadata and controls
137 lines (130 loc) · 4.32 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include "MedidasBase.h"
/*------------------ Derived class TesteMedidas from MedidasBase ------------------*/
class TesteMedidas: public MedidasBase{
public:
void imprimeAlpha(){
for(int i2=0;i2<46;i2++){
cout << alphas[i2] << "\n";
}
}
void lerAlphas(int emotion){
ifstream infilestream;
string line;
string line2;
float n;
int i=0;
if (emotion==1) infilestream.open("1_Alfas_Neutra_Satisfação.txt");
if (emotion==2) infilestream.open("2_Alfas_Neutra_Tristeza.txt");
if (emotion==3) infilestream.open("3_Alfas_Neutra_Surpresa.txt");
if (emotion==4) infilestream.open("4_Alfas_Neutra_Medo.txt");
if (emotion==5) infilestream.open("5_Alfas_Neutra_Raiva.txt");
if (emotion==6) infilestream.open("6_Alfas_Neutra_Aversao.txt");
for(int x=0;x<5;x++){
infilestream >> line;
}
//SEsquerda
for(int x=0;x<3;x++){
infilestream >> line;
}
for(int x=0;x<6;x++){
infilestream >> line;
infilestream >> line;
infilestream >> n;
alphas[i++]=n;
}
//SDireita
for(int x=0;x<3;x++){
infilestream >> line;
}
for(int x=0;x<6;x++){
infilestream >> line;
infilestream >> line;
infilestream >> n;
alphas[i++]=n;
}
//Oesquerdo
for(int x=0;x<3;x++){
infilestream >> line;
}
for(int x=0;x<8;x++){
infilestream >> line;
infilestream >> line;
infilestream >> n;
alphas[i++]=n;
}
//Odireito
for(int x=0;x<3;x++){
infilestream >> line;
}
for(int x=0;x<8;x++){
infilestream >> line;
infilestream >> line;
infilestream >> n;
alphas[i++]=n;
}
//Nariz
for(int x=0;x<2;x++){
infilestream >> line;
}
for(int x=0;x<10;x++){
infilestream >> line;
infilestream >> line;
infilestream >> n;
alphas[i++]=n;
}
//Boca
for(int x=0;x<2;x++){
infilestream >> line;
}
for(int x=0;x<8;x++){
infilestream >> line;
infilestream >> line;
infilestream >> n;
alphas[i++]=n;
}
infilestream.close();
}
/*----------------------------------------------------*/
Grafo lerGrafo(){
Grafo grafo(1000);
ifstream infilestream;
string line;
//N
int tipo;
string id;
//R
int no1;
int no2;
int i=0;
infilestream.open("grafo2.txt");
while (infilestream) {
infilestream >> line;
if(line=="N") {
infilestream >> tipo;
infilestream >> id;
criaNo(tipo,id, &grafo);
}
if(line=="R") {
infilestream >> no1;
infilestream >> no2;
criaRelacaoBin(no1, no2, &grafo);
}
}
cont=0;
infilestream.close();
return grafo;
//grafo.buscaAndOr(grafo.n[0]);
}
/*----------------------------------------------------*/
void criaNo(int tipo,string valor, Grafo *g){
//printf("[[criando no %i]]\n", cont);
No n0(tipo,cont,valor,0);
g->n[cont]=n0;
cont++;
}
void criaRelacaoBin(int pai,int filho,Grafo * g){
//printf("[[criando aresta]]\n");
g->adicionarAresta(g->n[pai],g->n[filho]);
g->copiaArestas(&g->n[pai]);
}
};