Skip to content

Commit f3ed582

Browse files
committed
refactor: delete unused header and comment
1 parent 3601068 commit f3ed582

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

src/search/bfs/bfs.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
#ifndef BFS_HPP
22
#define BFS_HPP
33

4-
#include <vector>
5-
#include <queue>
6-
#include <string>
7-
#include <set>
8-
#include <algorithm>
9-
#include <chrono>
10-
114
#include "../../main_scene/main_scene.hpp"
5+
#include "../../utils/utils.hpp"
126

137
class bfs {
148
public:

src/search/ucs/ucs.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
#ifndef UCS_HPP
22
#define UCS_HPP
33

4-
#include <vector>
5-
#include <queue>
6-
#include <string>
7-
#include <set>
8-
#include <algorithm>
9-
#include <chrono>
10-
114
#include "../../main_scene/main_scene.hpp"
5+
#include "../../utils/utils.hpp"
126

137
class ucs {
148
public:

src/utils/utils.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ Solution Utils::search(const Board& initial_board, const vector<Piece>& initial_
254254
SearchNode initial_node(initial_pieces, initial_board, {}, initial_val);
255255
pq.push(initial_node);
256256

257-
godot::UtilityFunctions::print(godot::String::utf8(params.algorithm_name.c_str()) + ": Initial value: " + godot::String::num_int64(initial_val));
258-
259257
while (!pq.empty()) {
260258
SearchNode current_node = pq.top();
261259
pq.pop();
@@ -267,22 +265,9 @@ Solution Utils::search(const Board& initial_board, const vector<Piece>& initial_
267265
}
268266
visited.insert(current_state_str);
269267

270-
godot::UtilityFunctions::print(godot::String::utf8(params.algorithm_name.c_str()) + ": Exploring node. " + params.get_node_exploration(current_node) + ". Path length: " + godot::String::num_int64(static_cast<int64_t>(current_node.path.size())));
271-
if (current_node.piece_moved != ' ') {
272-
Coordinates new_pos_for_log = {-1, -1};
273-
for(const auto& p_state : current_node.pieces) {
274-
if (p_state.id == current_node.piece_moved) {
275-
new_pos_for_log = p_state.coordinates;
276-
break;
277-
}
278-
}
279-
godot::UtilityFunctions::print("Moved piece: ", godot::String::utf8(&current_node.piece_moved, 1), " from (", current_node.original_position.x, ",", current_node.original_position.y, ") to (", new_pos_for_log.x, ",", new_pos_for_log.y, ")");
280-
}
281-
282268
if (is_exit(current_node.board, current_node.pieces)) {
283269
result.is_solved = true;
284270
result.moves = current_node.path;
285-
godot::UtilityFunctions::print(godot::String::utf8(params.algorithm_name.c_str()) + ": Solution Found! " + params.get_solution_details(current_node, result) + ". Nodes visited: " + godot::String::num_int64(static_cast<int64_t>(result.node)));
286271
break;
287272
}
288273

src/utils/utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <queue>
1111
#include <set>
1212
#include <functional>
13+
#include <stack>
1314

1415
using namespace std;
1516
using namespace godot;

0 commit comments

Comments
 (0)