1 #ifndef AI_TOOLBOX_CASSANDRA_PARSER_HEADER_FILE
2 #define AI_TOOLBOX_CASSANDRA_PARSER_HEADER_FILE
7 #include <unordered_map>
16 using MDPVals = std::tuple<size_t, size_t, DumbMatrix3D, DumbMatrix3D, double>;
17 using POMDPVals = std::tuple<size_t, size_t, size_t, DumbMatrix3D, DumbMatrix3D, DumbMatrix3D, double>;
67 using IDMap = std::unordered_map<std::string, size_t>;
68 using ActionMap = std::unordered_map<std::string, std::function<void(
const std::string &)>>;
69 using Tokens = std::vector<std::string>;
78 void parseModelInfo(std::istream & input);
88 size_t extractIDs(
const std::string & line, IDMap & map);
98 Tokens tokenize(
const std::string & str,
const char * list);
112 std::vector<size_t> parseIndeces(
const std::string & str,
const IDMap & map,
size_t max);
125 std::vector<double> parseVector(Tokens::const_iterator begin, Tokens::const_iterator end,
size_t N);
138 std::vector<double> parseVector(
const std::string & str,
size_t N);
153 void processMatrix(
DumbMatrix3D & M,
const IDMap & d1map,
const IDMap & d3map);
166 std::vector<std::string> lines_;
181 IDMap observationMap_;