-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcassandra-driver.h
56 lines (47 loc) · 1.64 KB
/
cassandra-driver.h
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
#ifndef CASS_DRIVER_H
#define CASS_DRIVER_H
#include <string>
#include <map>
#include "cassandra-parser.h"
#include "pomdp.h"
// tell flex the prototype of the lexer
#define YY_DECL \
yy::CassParser::symbol_type yylex(CassDriver &driver)
// and instantiate it for the parser
YY_DECL;
class CassDriver {
protected:
BWC::POMDP* pomdp;
double discount_factor;
int weight_sign;
bool has_det_obs;
public:
CassDriver(BWC::POMDP*);
int result;
// Scan handling
void beginScan();
void endScan();
bool trace_scanning;
// parse file f, return 0 on success
int parse(const std::string &f);
std::string file;
bool trace_parsing;
// Error handling
void error(const yy::location &l, const std::string &m);
void error(const std::string &m);
// Building an MDP
void addTransition(ElemRef source, ElemRef action, ElemRef target,
double prob);
void addWeight(ElemRef source, ElemRef action, ElemRef target,
ElemRef obs, double weight);
void addObsTransition(ElemRef action, ElemRef target, ElemRef obs,
double prob);
void setDiscount(double discount);
void setWeightSign(int sign);
void setStates(std::vector<std::string> states);
void setActions(std::vector<std::string> actions);
void setObservations(std::vector<std::string> observations);
void setInitialDist(std::vector<ElemRef> states);
void setInitialDist(std::vector<double> probs);
};
#endif // CASS_DRIVER_H