Feature/dynamic scenario#59
Conversation
…re/dynamic-scenario
| "with debug symbols)\n" | ||
| << "\t--filter [id] (optional; run only query [id])\n" | ||
| << "\t--filter [id] (optional; run only inst [id])\n" | ||
| << "\t--dump-map [id] (optional; dump map at id to stderr)" |
| "values in scen file) \n" | ||
| << "\t--costs [costs file] (required if using a weighted " | ||
| "terrain algorithm)\n" | ||
| << "\t--v2-cost [type] (optional; change used cost type for v2 scen " |
There was a problem hiding this comment.
change to --cost and --cost-file, if read from file override instances by values in file
| double epsilon = (1.0 / (int)pow(10, precision)) / 2; | ||
| double delta = fabs(sol.sum_of_edge_costs_ - exp->distance()); | ||
|
|
||
| if(fabs(delta - epsilon) > epsilon) |
There was a problem hiding this comment.
check for no provided optimal cost case
| "values in scen file) \n" | ||
| << "\t--costs [costs file] (required if using a weighted " | ||
| "terrain algorithm)\n" | ||
| << "\t--v2-cost [type] (optional; change used cost type for v2 scen " |
There was a problem hiding this comment.
if cost not exists, ERROR!
dharabor
left a comment
There was a problem hiding this comment.
Looks good. some small changes mainly.
| #define WARTHOG_POSTHOC_DO(f) | ||
| #endif | ||
|
|
||
| struct gridmap_scenario |
There was a problem hiding this comment.
// convenience wrapper around initialisation code
| Search& algo, std::string alg_name, | ||
| warthog::util::scenario_manager& scenmgr, bool verbose, bool checkopt, | ||
| std::ostream& out) | ||
| Search& algo, std::string alg_name, gridmap_scenario& scen, bool verbose, |
There was a problem hiding this comment.
Do all possible instatiations of algo work with all possible gridmap_scenario instantiations?
| if(expander == nullptr) return 1; | ||
|
|
||
| out << "id\talg\texpanded\tgenerated\treopen\tsurplus\theapops" | ||
| out << "id\tsnapshot\talg\texpanded\tgenerated\treopen\tsurplus\theapops" |
There was a problem hiding this comment.
We should update the README with new column names + new command-line options. Also update examples.
| if(!scen.load_map(std::filesystem::path(mapname))) | ||
| { | ||
| WARTHOG_GCRIT("failed to load map"); | ||
| return 3; |
There was a problem hiding this comment.
What is this return code? Maybe we should be identifying the appropriate error code and running that? Maybe 5 would be better, or 2?
Please raise an issue to track this in the future (fix return codes)
https://en.wikipedia.org/wiki/Errno.h
| } | ||
|
|
||
| // check v2cost | ||
| if(v2cost.empty()) { v2cost = "8c-ncc"; } |
There was a problem hiding this comment.
This might need a bit of refactor given other comments around --cost and --cost-file params.
| }; | ||
|
|
||
| class gm_parser | ||
| class [[deprecated]] gm_parser |
There was a problem hiding this comment.
I think noone is impacted by this. just remove it?
| PATCH, | ||
| INST | ||
| }; | ||
| int type; ///< command type |
| int32_t bucket; ///< bucket id number (meta), snapshot id for dynamic | ||
| uint32_t | ||
| id; ///< SNAPSHOT: snapshot num, PATCH: patch to apply, INST: inst id | ||
| union cmd_ |
| @@ -1,48 +1,159 @@ | |||
| #include <warthog/io/grid.h> | |||
There was a problem hiding this comment.
the name doesn't match the object it contains. should be called bittable_serialise. also avoids confusion with gridmap
| @@ -0,0 +1,685 @@ | |||
| #include <warthog/io/scenario.h> | |||
Merge dynamic scenario support.