22 node_creator_builder_ptr_(
std::move(node_creator_builder_ptr))
25 assert(node_creator_builder_ptr_ !=
nullptr);
31 node_creator_map_.clear();
33 node_creator_builder_ptr_->Build(map_state, &node_creator_map_);
38 assert(0 <= start_depth);
39 assert(start_depth < max_depth);
40 assert(graph !=
nullptr);
46 while (cnt < graph->GetGraphSize())
49 if (start_depth <= graph->GetNode(cnt).depth && graph->
GetNode(cnt).
depth < max_depth)
51 std::vector<RobotStateNode> res_vec;
53 MakeNewNodesByCurrentNode(graph->
GetNode(cnt), cnt, &res_vec);
55 for (
const auto& i : res_vec)
68void GraphTreeCreator::MakeNewNodesByCurrentNode(
const RobotStateNode& current_node,
const int current_num, std::vector<RobotStateNode>* output_graph)
const
70 assert(output_graph !=
nullptr);
71 assert(output_graph->empty());
73 if (node_creator_map_.count(current_node.
next_move) > 0)
75 node_creator_map_.at(current_node.
next_move)->Create(current_node, current_num, output_graph);
81 node_creator_map_.begin()->second->Create(current_node, current_num, output_graph);
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
歩容パターングラフを作成する.
グラフ構造のためのノード(頂点).旧名 LNODE
int depth
[4 byte] 自身の深さ.一番上の親が深さ0となる.