19 std::unique_ptr<INodeCreatorBuilder>&& node_creator_builder_ptr)
20 : node_creator_builder_ptr_(
std::move(node_creator_builder_ptr)) {
22 assert(node_creator_builder_ptr_ !=
nullptr);
27 node_creator_map_.clear();
29 node_creator_builder_ptr_->Build(map_state, &node_creator_map_);
34 assert(0 <= start_depth);
35 assert(start_depth < max_depth);
36 assert(graph !=
nullptr);
42 while (cnt < graph->GetGraphSize()) {
44 if (start_depth <= graph->GetNode(cnt).depth &&
46 std::vector<RobotStateNode>
49 MakeNewNodesByCurrentNode(graph->
GetNode(cnt), cnt,
52 for (
const auto& i : res_vec) {
64void GraphTreeCreator::MakeNewNodesByCurrentNode(
66 std::vector<RobotStateNode>* output_graph)
const {
67 assert(output_graph !=
nullptr);
68 assert(output_graph->empty());
70 if (node_creator_map_.count(current_node.
next_move) > 0) {
71 node_creator_map_.at(current_node.
next_move)
72 ->Create(current_node, current_num, output_graph);
76 node_creator_map_.begin()->second->Create(current_node, current_num,
RobotStateNode 構造体をノードとする木構造のグラフのクラス.
constexpr bool IsEmpty() const
グラフが空かどうかを返す.
void AddNode(const RobotStateNode &node)
ノードを追加する. 追加するノードは親ノードのインデックスと,depthの指定が適切にされている必要がある. これらが適切にされていない場合,アサーションに引っかかる....
const RobotStateNode & GetNode(const int index) const
グラフのノードの参照を返す.
constexpr int GetGraphSize() const
グラフのノードの総数を返す.
void Init(const DividedMapState &map_state)
ノード生成クラスを初期化する.
GraphTreeCreator(std::unique_ptr< INodeCreatorBuilder > &&node_creator_builder_ptr)
GraphSearchResult CreateGraphTree(int start_depth, int max_depth, GaitPatternGraphTree *graph_ptr) const
歩容パターングラフを作成する.
int depth
[4 byte] 自身の深さ.一番上の親が深さ0となる.