Cell2Fire
A large-scale forest fire simulator.
Loading...
Searching...
No Matches
WriteCSV.h
1#ifndef WRITECSV
2#define WRITECSV
3
4#include <algorithm>
5#include <boost/algorithm/string.hpp>
6#include <cmath>
7#include <fstream>
8#include <iostream>
9#include <iterator>
10#include <set>
11#include <string>
12#include <unordered_map>
13#include <unordered_set>
14#include <vector>
15
16/*
17 * A class to read data from a csv file.
18 */
20{
21 public:
22 // inmutable
23 std::string fileName;
24 std::string delimeter;
25
26 // mutable
27 int linesCount;
28
29 // Constructor
30 CSVWriter(std::string filename, std::string delm = ",");
31
32 // Function to write data (row) to a CSV File
33 template <typename T>
34 void addDatainRow(T first, T last);
35
36 // Function to write the entire file
37 void printCSV(int rows, int cols, std::vector<int> statusCells);
38 void printCSVDouble(int rows, int cols, std::vector<double> network);
39 void printCSVDouble_V2(int rows, int cols, std::vector<double> network);
40 void
41 printASCII(int rows, int cols, double xllcorner, double yllcorner, int cellside, std::vector<float> statusCells);
42 void
43 printASCIIInt(int rows, int cols, double xllcorner, double yllcorner, int cellside, std::vector<int> statusCells);
44 void asciiHeader(int rows, int cols, double xllcorner, double yllcorner, int cellside);
45 void printWeather(std::vector<std::string> weatherHistory);
46 void printIgnitions(std::unordered_map<int, int> ignitionsHistory);
47 void printCSV_V2(int rows, int cols, std::vector<int> statusCells);
48 // Function to create a directory
49 void MakeDir(std::string pathPlot);
50};
51
52#endif
Definition WriteCSV.h:20