Skip to content

Commit

Permalink
Output folder-file for repair mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jsego committed Sep 29, 2023
1 parent 2042b0c commit ec25377
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ namespace runner{
if(resulting_node != nullptr ){
auto resulting_program = resulting_node->get_program();
utils::print_to_file(dest_file_name+".prog", resulting_program->to_string(false));
//utils::print_to_file(output_file+".prog", resulting_program->to_string(false));
stats_info->add_info_msg("SOLUTION FOUND!!!\n" + resulting_program->to_string(false));
}
else{
Expand Down
7 changes: 6 additions & 1 deletion src/utils/argument_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ namespace utils {
_program_lines = read_program_instructions(_program_file_name).size();
auto folder_files = utils::split(_program_file_name,"/");
// Get the file name of the input program
_output_file = utils::split(folder_files[folder_files.size()-1],".")[0];
auto program_name = utils::split(folder_files[folder_files.size()-1],".")[0];
if(_output_file.empty())
_output_file = program_name;
else if(_output_file[_output_file.size()-1] == '/') // if the output is a folder
_output_file += program_name;
// else // do nothing, keep the folder/file input values
}
if (arg_map.find(_theory_ntype) == arg_map.end())
_theory_name = "cpp";
Expand Down
3 changes: 2 additions & 1 deletion src/utils/bfgp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ namespace utils{
if(not out_file.empty()){
auto problem_folders = split(out_file, "/"); // last is the output file
out_folder = "";
for(size_t idx=0; idx+1<problem_folders.size(); ++idx)
int is_last_file = (out_file[out_file.size()-1]=='/'?0:1);
for(size_t idx=0; idx+is_last_file<problem_folders.size(); ++idx)
out_folder += problem_folders[idx]+"/";
out_file = problem_folders[problem_folders.size()-1];
}
Expand Down

0 comments on commit ec25377

Please sign in to comment.