GPPC: Grid-Based Path Planning Competition
GPPC Classic Track Sample Code
Sample code last updated: May 3, 2012Sample code that is similar to what will run in the compeititon, with a very simple pathfinding implementation is available for download. It contains the following files:
- main.cpp: Sample main program which loads the map and runs your code with the provided API. A different main.cpp may be used during the actual competition, so do not modify this file!
- ScenarioLoader: Class that loads a scenario. Do not modify this file!
- Timer: Timer class for timing code execution. Do not modify this file!
- Entry.h: Required API that each entry must implement to enter the competition.
- Entry.cpp: Sample API implementation.
- AcrosstheCape.map, AcrosstheCape.map.scen: Sample maps/scenario files.
- rmtst01.map, rmtst01.map.scen: Sample maps/scenario files.
void PreprocessMap(std::vector &bits, int width, int height, const char *filename); void *PrepareForSearch(std::vector &bits, int width, int height, const char *filename); bool GetPath(void *data, xyLoc s, xyLoc g, std::vectorIn PreprocessMap your program is provided the map and can do any necessary processing. The results of this processing should be saved in the file name provided. Attempts to read or write from any other file will be grounds for disqualification. In PrepareForSearch your program is provided the map again along with the file name where it can load data for this map. The program can return a (void *) reference to any data that it wants to be passed when GetPath is called. GetPath is called with a start and goal location, and the path is incrementally added to the end of the path vector. GetPath should return true if the path is complete. GetPath will be called repeatedly with the same arguments until true is returned.
&path); const char *GetName();