Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group 1 Wed Sept 27th checkin #21

Merged
merged 50 commits into from
Oct 19, 2023
Merged

Conversation

mdkdoc15
Copy link
Contributor

This PR will add the first external agent of group one. It tracks a path using A* to a given coordinate.
auto my_agent = dynamic_cast<cse491::walle::matt_k_first_agent *>(agent); my_agent->set_word(&world); my_agent->set_goal_position(cse491::GridPosition(1, 8)); my_agent->SetPosition(3, 1);

Will create an agent that goes from position (3,1) to (1,8) While avoiding walls and other un-walkable areas defined by the world.

Future changes:

  1. Assert goal position and world pointer are not Null to avoid seg faults
  2. Refector agent to have a better name than matt_k_first agent
  3. Add additional agent with user defined path to follow
  4. Add capability of agent to track moving target.

Copy link
Contributor

@Kanakmk Kanakmk left a comment

Choose a reason for hiding this comment

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

Reviewed and everything checks out!!

Copy link
Contributor

@FergusonAJ FergusonAJ left a comment

Choose a reason for hiding this comment

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

Overall the changes look good. This PR adds A* pathfinding and an agent that uses it to move between multiple waypoints.

Two things we should change before merging:

  1. Switch the .h files to .hpp to keep things consistent
  2. Similarly, changing shortest_path to be more consistent with the rest of the methods. Maybe something like GetShortestPath or FindShortestPath?

Group 1 - README.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

We should figure out what we want to put in the comment block at the top of each file eventually.

source/Agents/AgentLibary.h Outdated Show resolved Hide resolved
source/core/WorldBase.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@FergusonAJ FergusonAJ left a comment

Choose a reason for hiding this comment

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

Went through in more detail this time.
There is one critical change left: to remove a circular include. Instructions for how to do that are in one of the review comments.

Thanks for making the other changes earlier!

Group 1 - README.md Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

The include of WorldBase is unnecessary and creates a circular include. This prevents the code from compiling on my machine. We should remove it.

// If the last step failed, or we need a new path the then regenerate the path
if (action_result == 0 || path.empty() || current_move_num > recalculate_after_x_turns)
{
path = world->ShortestPath(GetPosition(), goal_position);
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to know which agent is asking for the shortest path.

@FergusonAJ FergusonAJ changed the base branch from main to development October 19, 2023 19:00
@FergusonAJ FergusonAJ merged commit 5793f03 into MSU-CSE491:development Oct 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants