22 template<
typename TGr
id>
24 std::tuple<TGrid, typename TGrid::node_type, typename TGrid::node_type>
25 parse(
const std::string &filename);
32template<
typename TGr
id>
33std::tuple<TGrid, typename TGrid::node_type, typename TGrid::node_type>
35 using node_type =
typename TGrid::node_type;
36 std::ifstream file(filename);
38 if (!file.is_open()) {
39 throw std::runtime_error(
"Could not open file: '" + filename +
"'.");
43 unsigned long height, width,
i = 0, j = 0;
53 TGrid
grid(height, width);
54 node_type
start(0, 0), goal(0, 0);
56 while (getline(file, line)) {
58 for (
const auto &c: line) {
62 }
else if (c ==
'G') {
65 }
else if (c !=
'.') {
66 grid.addObstacle(
i, j);
Definition: SquareGridMapParser.hpp:19
static std::tuple< TGrid, typename TGrid::node_type, typename TGrid::node_type > parse(const std::string &filename)
Definition: SquareGridMapParser.hpp:34
int i
Definition: AllEpsilonClosure.h:118
constexpr const T & max(const T &a)
Root case of maximum computation. The maximum from one value is the value itself.
Definition: algorithm.hpp:278
constexpr auto make_tuple(Elements &&... args)
Helper of extended tuple construction. The tuple is constructed from values pack, types are deduced.
Definition: tuple.hpp:203
Definition: ReconstructPath.hpp:14
Definition: GridDirection.hpp:12
void start(measurements::stealth_string name, measurements::Type type)
Definition: measurements.cpp:14