-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from doruirimescu/Development
Development
- Loading branch information
Showing
22 changed files
with
519 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
output: main.o Astar.o MAPPGridState.o Agent.o heuristic.o | ||
g++ main.o Astar.o MAPPGridState.o Agent.o heuristic.o -o output | ||
|
||
main.o: main.cpp | ||
g++ -c main.cpp | ||
|
||
Astar.o: Astar.cpp Astar.hpp | ||
g++ -c Astar.cpp | ||
|
||
MAPPGridState.o: MAPPGridState.cpp MAPPGridState.hpp | ||
g++ -c MAPPGridState.cpp | ||
|
||
Agent.o: Agent.cpp Agent.hpp | ||
g++ -c Agent.cpp | ||
|
||
heuristic.o: heuristic.cpp heuristic.hpp | ||
g++ -c heuristic.cpp | ||
clean: | ||
rm main.o Astar.o MAPPGridState.o Agent.o heuristic.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Description | ||
**Programming language: C++11 and newer** | ||
|
||
Multi-agent path planning (MAPP) using the A* algorithm. This implementation is based on the [Aalto CS-E4800 Artificial Intelligence](https://mycourses.aalto.fi/course/view.php?id=24364) course, where I was a teaching assistant. | ||
|
||
The problem comprises of a two-dimensional grid, where there are set of agents (each with its own location and goal) and optionally, a set of walls representing locations where no agent can be. | ||
|
||
## File descriptions | ||
| Class | Description | Location | | ||
| ---------------- | ------------------------------------------------------------------------------------ |-----------| | ||
| Wall | A grid location where no agent can be located at any time. _Walls should not be added at any agent's goal coordinates._ | Wall.hpp | | ||
| Agent | An intelligent agent, moving in a two-dimensional grid from a starting position towards its goal (final position). In multi-agent problems such as this one, _there can be more than one single agent pursuing its goal at any time in the grid_.| Agent.hpp, Agent.cpp | | ||
| MAPPGridState | The state-space representation of a grid comprises of a vector of MAPPGridStates, each such state representing a collection of agents and their current positions on the grid, together with the total cost which took to reach the state, and the _state heuristic -the estimated cost to reach the goal state-_. The cost of moving from one state to the successor (next) state is always 1, since in this representation only one agent can move per state transition. The state heuristic is computed as the sum of all individual heuristics of the agents. | MAPPGridState.hpp, MAPPGridState.cpp | | ||
|
||
| Namespace | Description | Location | | ||
| ---------------- | ------------------------------------------------------------------------------------ |-----------| | ||
| heuristic | Contains a function that computes the heuristic of an agent, ie. the estimate of the distance from the current location to the goal. It is enouraged to add more heuristics -if required by the problem- in this namespace. | heuristic.hpp, heuristic.cpp | | ||
| Astar | Contains the actual A* algorithm, used to search the state-space and retrieve the best state trajectory that solves the problem. | Astar.hpp, Astar.cpp | | ||
|
||
| File | Description | | ||
| ---------------- | ------------------------------------------------------------------------------------ | | ||
| porting.hpp | For easily porting the standard library-based implementation to other frameworks (such as QT). | | ||
| main.cpp | For demonstrating the usage of the Astar program in a practical scenario. | | ||
| test/AstarTests.cpp | Unit tests that shall pass after any modification that is made to the program. | | ||
|
||
# Compile and run | ||
In order to compile and run the program, run the following commands: | ||
|
||
```make``` | ||
|
||
```./output``` | ||
|
||
```make clean``` | ||
|
||
# Google Test | ||
In order to run the unit tests, run the following commands from the Astar folder. | ||
|
||
```cmake --build build --config Debug --target all -- -j 6``` | ||
|
||
```cd build``` | ||
|
||
```ctest -j6 -C Debug -T test --output-on-failure``` | ||
|
||
Or, you can open the project with Visual Studio Code and run the tests from the status bar, CMake Tools extension is needed. | ||
|
||
For more details on Google Test with VS Code, watch : https://youtu.be/Lp1ifh9TuFI |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### | ||
####### Any changes to this file will be overwritten by the next CMake run #### | ||
####### The input file was Config.cmake.in ######## | ||
|
||
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) | ||
|
||
macro(set_and_check _var _file) | ||
set(${_var} "${_file}") | ||
if(NOT EXISTS "${_file}") | ||
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") | ||
endif() | ||
endmacro() | ||
|
||
macro(check_required_components _NAME) | ||
foreach(comp ${${_NAME}_FIND_COMPONENTS}) | ||
if(NOT ${_NAME}_${comp}_FOUND) | ||
if(${_NAME}_FIND_REQUIRED_${comp}) | ||
set(${_NAME}_FOUND FALSE) | ||
endif() | ||
endif() | ||
endforeach() | ||
endmacro() | ||
|
||
#################################################################################### | ||
include(CMakeFindDependencyMacro) | ||
if (ON) | ||
set(THREADS_PREFER_PTHREAD_FLAG ) | ||
find_dependency(Threads) | ||
endif() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/GTestTargets.cmake") | ||
check_required_components("") |
Oops, something went wrong.