#include <kruskals_generator.hxx>
Classes | |
struct | CellInfoBucket |
Public Types | |
typedef Grid< CellInfoBucket > | Maze |
typedef Maze::Cell | Cell |
typedef Maze::Edge | Edge |
typedef Maze::Point | Point |
Public Member Functions | |
std::unique_ptr< Maze > | operator() (const uint32_t width, const uint32_t height, const uint32_t seed=0) |
Static Private Member Functions | |
static void | MergeBucket (std::vector< std::vector< std::shared_ptr< Cell >>> &buckets, uint32_t fromId, uint32_t ToId) |
Detailed Description
Kruskal's Generator - Generate a maze using a kruskal's strategy.
Kruskal's Maze Generator is a randomized version of Kruskal’s algorithm: a method for producing a minimal spanning tree for a weighted graph.
Kruskal's is interesting because it doesn't "grow" the Maze like a tree, but rather carves passage segments all over the Maze at random, making it very fun to watch. Still, it results in a perfect Maze in the end.
The counterpart is to require storage proportional to the size of the Maze, along with the ability to enumerate each edge between cells in random order (Using here a set of edges and taking them randomly).
- Parameters
-
width desired width for the maze. height desired height for the maze. seed number used to initiate the random generator.
- Returns
- Operator() returns Maze Grid pointer to be owned, nullptr if construction failed.
Definition at line 50 of file kruskals_generator.hxx.
Member Typedef Documentation
Definition at line 57 of file kruskals_generator.hxx.
Definition at line 58 of file kruskals_generator.hxx.
Definition at line 56 of file kruskals_generator.hxx.
Definition at line 59 of file kruskals_generator.hxx.
Member Function Documentation
|
inlinestaticprivate |
MergeBucket - Merge two buckets of node together and update node bucket Id.
- Parameters
-
buckets vector containing all the buckets fromId bucket id that will be merged within the other bucket ToId bucket id that will receive the other bucket cells
- Returns
- void.
Definition at line 118 of file kruskals_generator.hxx.
|
inline |
Definition at line 61 of file kruskals_generator.hxx.
The documentation for this class was generated from the following file: