35 data_filename(
"data_filename",
"mazes.csv")
42 LOG(LSTATUS) <<
"Importing mazes from file: " <<
data_filename;
49 if (data_file.is_open()) {
53 std::getline(data_file, line);
57 std::getline(data_file, line);
59 std::stringstream ss(line);
66 LOG(LDEBUG) <<
"maze_width=" << maze_width <<
" maze_height=" <<
maze_height ;
70 std::getline(data_file, line);
71 LOG(LDEBUG) <<
"2nd header : " << line ;
74 while (std::getline(data_file, line)) {
75 LOG(LDEBUG) << line <<
'\n';
78 mic::types::MatrixXiPtr mat (
new mic::types::MatrixXi(maze_height, maze_width));
82 std::stringstream ss(line);
89 (*mat)(col, row) = value;
90 LOG(LDEBUG) <<
" " << i <<
"("<< col<<
","<< row <<
")|" << value;
101 sample_data.push_back(mat);
105 LOG(LINFO) <<
"Imported " << sample_data.size() <<
" mazes of size (h x w) = " << maze_height <<
" x " <<
maze_width;
108 for (
size_t i=0; i < sample_data.size(); i++ ){
109 sample_labels.push_back( std::make_shared <size_t> (i) );
110 sample_indices.push_back(i);
113 LOG(LINFO) <<
"Data import finished";
118 LOG(LFATAL) <<
"Oops! Couldn't find file: " <<
data_filename;
mic::configuration::Property< std::string > data_filename
size_t maze_height
Height of a maze.
size_t maze_width
Width of a maze.
MazeMatrixImporter(std::string node_name_="maze_importer")