-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavSymbolic.hpp
49 lines (46 loc) · 1.13 KB
/
avSymbolic.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
// Author: Kristi Daigh
// Project: MLEM2 Rule Induction
// Date: 11/20/2019
/** Header file for the attribute-value
symbolic block object. This is a subclass
of the block type.
@file avSymbolic.hpp */
#ifndef AV_SYMBOLIC_H
#define AV_SYMBOLIC_H
#include "av.hpp"
#include <list>
#include <iostream>
#include <string>
#include <sstream>
class AVSymbolic : public AV {
public:
AVSymbolic(string attr, int attrCol, string value)
: AV(attr, attrCol) {
m_value = value;
}
bool addOnMatch(Value * value, int x){
if(m_value.compare(value->getStrValue()) == 0){
m_block.insert(x);
return true;
}
return false;
}
bool isNumeric() const {
return false;
}
void print() const {
cout << "[(" << m_attr << ", " << m_value << ")] = {";
for(int caseNo : m_block){
cout << caseNo << ", ";
}
cout << "}" << endl;
}
std::string labelString() const {
stringstream stream;
stream << "(" << m_attr << ", " << m_value << ")";
return stream.str();
}
private:
string m_value;
};
#endif