Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions Cell2Fire/Cell2Fire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2403,20 +2403,6 @@ Cell2Fire::Step(std::default_random_engine generator, int ep)
this->sim += 1;
}

if ((this->sim > args.TotalSims) && (args.WeatherOpt != "rows"))
{
this->counter_wt += 1;
if (this->counter_wt <= 1)
{
// Weather History Folder
std::string filename = "WeatherHistory.csv";
CSVWriter WtHistoryFolder("", "");
this->historyFolder = this->args.OutFolder + "WeatherHistory" + separator();
WtHistoryFolder.MakeDir(this->historyFolder);
CSVWriter WtFile(this->historyFolder + filename);
WtFile.printWeather(WeatherHistory);
}
}
// Print current status
if (!this->done && this->args.verbose)
{
Expand Down
1 change: 1 addition & 0 deletions Cell2Fire/Cell2Fire.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Cell2Fire
string crownFlameLengthFolder;
string historyFolder;
string ignitionsFolder;
string weathersFolder;

// Vectors
std::vector<int> fire_period;
Expand Down
26 changes: 14 additions & 12 deletions Cell2Fire/WriteCSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,37 +254,39 @@ CSVWriter::printASCIIInt(
}

void
CSVWriter::printWeather(std::vector<std::string> weatherHistory)
CSVWriter::printIgnitions(std::unordered_map<int, int> ignitionsHistory)
{
std::ofstream ofs(this->fileName, std::ofstream::out);
std::ofstream ofs(fileName, std::ofstream::out);
int i;

for (i = 0; i < weatherHistory.size(); i++)
// Print column titles
ofs << "sim,point\n";

// Iterate through the map and print key-value pairs
for (i = 1; i < ignitionsHistory.size() + 1; i++)
{
ofs << weatherHistory[i] << "\n";
ofs << i << "," << ignitionsHistory[i] << "\n";
// ofs << i << "," << ignitionsHistory[i-1] << "\n";
}

// Close file
ofs.close();
}

void
CSVWriter::printIgnitions(std::unordered_map<int, int> ignitionsHistory)
CSVWriter::printWeathers(std::unordered_map<int, std::string> weathersHistory)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is never called.

{
std::ofstream ofs(fileName, std::ofstream::out);
int i;

// Print column titles
ofs << "sim,point\n";
ofs << "sim,weatherfile\n";

// Iterate through the map and print key-value pairs
for (i = 1; i < ignitionsHistory.size() + 1; i++)
for (i = 1; i < weathersHistory.size() + 1; i++)
{
ofs << i << "," << ignitionsHistory[i] << "\n";
// ofs << i << "," << ignitionsHistory[i-1] << "\n";
ofs << i << "," << weathersHistory[i] << "\n";
}

// Close file
ofs.close();
}

void
Expand Down
2 changes: 1 addition & 1 deletion Cell2Fire/WriteCSV.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CSVWriter
void
printASCIIInt(int rows, int cols, double xllcorner, double yllcorner, int cellside, std::vector<int> statusCells);
void asciiHeader(int rows, int cols, double xllcorner, double yllcorner, int cellside);
void printWeather(std::vector<std::string> weatherHistory);
void printWeathers(std::unordered_map<int, std::string> weathersHistory);
void printIgnitions(std::unordered_map<int, int> ignitionsHistory);
void printCSV_V2(int rows, int cols, std::vector<int> statusCells);
// Function to create a directory
Expand Down
Binary file modified test/target_results.zip
Binary file not shown.
Loading