GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
DesignLab
gait_pattern_graph_tree.cpp
[詳解]
1
3
4
// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5
// Released under the MIT license
6
// https://opensource.org/licenses/mit-license.php
7
8
#include "
gait_pattern_graph_tree.h
"
9
10
namespace
designlab
{
11
12
const
RobotStateNode
&
GaitPatternGraphTree::GetParentNode
(
13
const
int
index,
const
int
depth)
const
{
14
assert(0 <= index);
15
assert(index < graph_size_);
16
assert(0 <= depth);
17
assert(depth <= nodes_[index].depth);
18
19
int
res_index = index;
20
21
while
(
true
) {
22
if
(depth == nodes_[res_index].depth) {
23
break
;
24
}
25
26
res_index = nodes_[res_index].parent_index;
27
}
28
29
return
nodes_[res_index];
30
}
31
32
const
int
GaitPatternGraphTree::GetParentNodeIndex
(
const
int
index,
33
const
int
depth)
const
{
34
assert(0 <= depth);
35
assert(depth <= nodes_[index].depth);
36
assert(0 <= index);
37
assert(index < graph_size_);
38
39
int
res_index = index;
40
41
while
(
true
) {
42
if
(depth == nodes_[res_index].depth) {
43
break
;
44
}
45
46
res_index = nodes_[res_index].parent_index;
47
}
48
49
return
res_index;
50
}
51
52
}
// namespace designlab
designlab::GaitPatternGraphTree::GetParentNodeIndex
const int GetParentNodeIndex(const int index, const int depth) const
指定したノードの親ノードの参照を返す.depthは親ノードの深さを指定する.
Definition
gait_pattern_graph_tree.cpp:32
designlab::GaitPatternGraphTree::GetParentNode
const RobotStateNode & GetParentNode(const int index, const int depth) const
指定したノードの親ノードの参照を返す.depthは親ノードの深さを指定する.
Definition
gait_pattern_graph_tree.cpp:12
gait_pattern_graph_tree.h
designlab
Definition
abstract_dxlib_gui.cpp:18
designlab::RobotStateNode
グラフ構造のためのノード(頂点).
Definition
robot_state_node.h:39
構築:
1.9.8