Skip to content

Commit

Permalink
Validation mode has an optional output prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jsego committed Sep 29, 2023
1 parent bf4b144 commit 2042b0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ namespace runner{
auto vps = prog->run( gpp, save_pddl_plans );

if(save_pddl_plans){
if((not dest_file_name.empty()) and (dest_file_name[dest_file_name.size()-1] != '/'))
dest_file_name += ".";
for(size_t instance_id = 1; instance_id <= gpp->get_num_instances(); instance_id++){
std::ofstream ofs(dest_file_name + ".plan." + std::to_string(instance_id));
std::ofstream ofs(dest_file_name + "plan." + std::to_string(instance_id));
for(const auto& str_act : prog->get_plan(instance_id))
ofs << str_act << "\n";
ofs.close();
Expand Down
5 changes: 5 additions & 0 deletions src/utils/argument_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ namespace utils {
helper("Exactly one boolean expected but " + std::to_string(arg_vals.size()) + " found.");
parse_verbosity(arg_vals[0]);
}
else if(arg_type == _output_file_ntype){
if(arg_vals.size() != 1u)
helper("Exactly one output file expected but " + std::to_string(arg_vals.size()) + " found.");
parse_output_file(arg_vals[0]);
}
else if(arg_type == _save_pddl_plans_ntype){
if(arg_vals.size() != 1u)
helper("Exactly one boolean expected but " + std::to_string(arg_vals.size()) + " found.");
Expand Down

0 comments on commit 2042b0c

Please sign in to comment.