Skip to content

Commit

Permalink
Update Agent.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tolstenko authored Oct 11, 2023
1 parent a7c4c19 commit 3fe827a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/catchthecat/Agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace std;
std::vector<Point2D> Agent::generatePath(World* w){
unordered_map<Point2D, Point2D> cameFrom; // to build the flowfield and build the path
queue<Point2D> frontier; // to store next ones to visit
unordered_set<Point2D> frontierSet; // OPMIZATION to check faster if a point is in the queue
unordered_set<Point2D> frontierSet; // OPTIMIZATION to check faster if a point is in the queue
unordered_map<Point2D, bool> visited; // use .at() to get data, if the element dont exist [] will give you wrong results

// bootstrap state
Expand All @@ -30,4 +30,4 @@ std::vector<Point2D> Agent::generatePath(World* w){
// if the border is not infinity, build the path from border to the cat using the camefrom map
// if there isnt a reachable border, just return empty vector
// if your vector is filled from the border to the cat, the first element is the catcher move, and the last element is the cat move
}
}

0 comments on commit 3fe827a

Please sign in to comment.