Skip to content

Feature/dynamic scenario#59

Draft
heavenfall wants to merge 63 commits into
developfrom
feature/dynamic-scenario
Draft

Feature/dynamic scenario#59
heavenfall wants to merge 63 commits into
developfrom
feature/dynamic-scenario

Conversation

@heavenfall
Copy link
Copy Markdown
Collaborator

Merge dynamic scenario support.

@heavenfall heavenfall changed the base branch from main to develop May 5, 2026 03:02
Comment thread apps/warthog.cpp
"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)"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

set to inst id

Comment thread apps/warthog.cpp
"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 "
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

change to --cost and --cost-file, if read from file override instances by values in file

Comment thread apps/warthog.cpp
double epsilon = (1.0 / (int)pow(10, precision)) / 2;
double delta = fabs(sol.sum_of_edge_costs_ - exp->distance());

if(fabs(delta - epsilon) > epsilon)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

check for no provided optimal cost case

Comment thread apps/warthog.cpp
"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 "
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

if cost not exists, ERROR!

Copy link
Copy Markdown
Member

@dharabor dharabor left a comment

Choose a reason for hiding this comment

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

Looks good. some small changes mainly.

Comment thread apps/warthog.cpp
#define WARTHOG_POSTHOC_DO(f)
#endif

struct gridmap_scenario
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

// convenience wrapper around initialisation code

Comment thread apps/warthog.cpp
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,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do all possible instatiations of algo work with all possible gridmap_scenario instantiations?

Comment thread apps/warthog.cpp
if(expander == nullptr) return 1;

out << "id\talg\texpanded\tgenerated\treopen\tsurplus\theapops"
out << "id\tsnapshot\talg\texpanded\tgenerated\treopen\tsurplus\theapops"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should update the README with new column names + new command-line options. Also update examples.

Comment thread apps/warthog.cpp
if(!scen.load_map(std::filesystem::path(mapname)))
{
WARTHOG_GCRIT("failed to load map");
return 3;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Comment thread apps/warthog.cpp
}

// check v2cost
if(v2cost.empty()) { v2cost = "8c-ncc"; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might need a bit of refactor given other comments around --cost and --cost-file params.

};

class gm_parser
class [[deprecated]] gm_parser
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think noone is impacted by this. just remove it?

PATCH,
INST
};
int type; ///< command type
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

newline

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_
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

newline

Comment thread src/io/grid.cpp
@@ -1,48 +1,159 @@
#include <warthog/io/grid.h>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the name doesn't match the object it contains. should be called bittable_serialise. also avoids confusion with gridmap

Comment thread src/io/scenario.cpp
@@ -0,0 +1,685 @@
#include <warthog/io/scenario.h>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants