Skip to content
Snippets Groups Projects
Commit dced2859 authored by Taha's avatar Taha
Browse files

feat: update main

parent cda9fc53
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ void SaveSOG(const SOG& sog, const string& sog_file) {
*/
void PrintOutputObsWeights(const RdP::net& model, SOG& sog,
const map<int, int>& obs_transitions,
const Paths& obs_paths,
const std::vector<std::vector<std::string>> obs_paths,
const std::vector<int>& weight_obs_paths,
const string& output_file_prefix) {
sog.PrintCompleteInformation();
......@@ -120,19 +120,22 @@ void PrintOutputObsWeights(const RdP::net& model, SOG& sog,
ofstream weight_file(output_file);
weight_file << "# path weights: " << weight_obs_paths.size() << '\n';
for (auto w_path : weight_obs_paths) {
weight_file << w_path << '\n';
if (w_path !=0)
weight_file << w_path << '\n';
}
weight_file << '\n';
//weight_file << '\n';
// save observable paths in the folder
std::string output_obs_paths = output_file_prefix + "_obs_paths.txt";
ofstream obs_paths_file(output_obs_paths);
obs_paths_file << "# obs. paths: " << obs_paths.size() << '\n';
obs_paths_file << "# obs. paths: " << obs_paths.size(); //<< '\n';
for (const auto& obs_p : obs_paths) {
for (auto t_label : obs_p) {
obs_paths_file << t_label << '_';
cout << t_label << "_";
if (obs_p.size()!=0){
for (auto t_label : obs_p) {
obs_paths_file << t_label << '_';
cout << t_label << "_";
}
}
obs_paths_file << '\n';
cout << '\n';
......@@ -307,9 +310,9 @@ void ComputeAbstractPaths(const std::string& net_file, int bound, bool only_sog,
pn_sog.GenerateSOG(sog);
auto sog_time = GetTime() - start_sog_time;
std::cout << " done\nTime for computing SOG: " << sog_time << " seconds\n";
std::cout<<"--------------------"<<std::endl;
sog.PrintCompleteInformation();
std::cout<<"--------------------"<<std::endl;
// std::cout<<"--------------------"<<std::endl;
// sog.PrintCompleteInformation();
// std::cout<<"--------------------"<<std::endl;
auto elapsed_time = GetTime() - start_time;
std::cout << "\nTotal time: " << elapsed_time << " seconds\n";
......@@ -402,7 +405,7 @@ void SaveObsPathsAndWeights(const string& net_file, int bound,
auto sog_time = GetTime() - start_sog_time;
cout << " done\nTime for computing SOG: " << sog_time << " seconds\n";
sog.PrintCompleteInformation();
// sog.PrintCompleteInformation();
std::cout << "\nGenerating regex from the SOG ... ";
auto start_regex_time = GetTime();
const std::string language = pn_sog.GenerateRegExp(&sog).begin()->first;
......@@ -442,9 +445,8 @@ void SaveObsPathsAndWeights(const string& net_file, int bound,
cout << "\nTotal time: " << elapsed_time << " seconds\n";
// print output
PrintOutputObsWeights(model, sog, obs_trans, obs_paths, weight_obs_paths,
PrintOutputObsWeights(model, sog, obs_trans, paths, weight_obs_paths,
output_file_prefix);
}
/******************************************************************************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment