37 #ifndef JSK_FOOTSTEP_PLANNER_SOLVER_NODE_H_
38 #define JSK_FOOTSTEP_PLANNER_SOLVER_NODE_H_
42 #include <boost/shared_ptr.hpp>
43 #include <boost/weak_ptr.hpp>
49 template <
class StateT,
class GraphT>
55 typedef typename GraphT::Ptr
GraphPtr;
73 std::vector<Ptr> solver_nodes;
74 for (
size_t i = 0;
i < successors.size();
i++) {
81 solver_nodes.push_back(solver_node);
87 std::vector<Ptr>
expand(
Ptr this_ptr,
bool verbose)
90 std::vector<Ptr> solver_nodes;
92 std::vector<StatePtr> successors = graph_ptr->successors(
state_);
94 std::cerr << successors.size() <<
" successors" << std::endl;
101 throw std::runtime_error(
"no graph is set in SolverNode");
113 std::vector<SolverNode::Ptr>
117 return std::vector<SolverNode::Ptr>();
120 std::vector<SolverNode::Ptr> parent_path =
parent_->getPathWithoutThis();
121 parent_path.push_back(
parent_);
131 return a->getSortValue() <
b->getSortValue();
137 return a->getSortValue() >
b->getSortValue();
152 #if 0 // Not using, but for testing
153 template <
class StateT,
class GraphT>
154 class SolverNodeSingleton :
public SolverNode< StateT, GraphT >
160 typedef typename GraphT::Ptr
GraphPtr;
173 std::vector<Ptr> wrapWithSolverNodes(
Ptr this_ptr, std::vector<StatePtr> successors)
176 std::vector<Ptr> solver_nodes;
177 for (
size_t i = 0;
i < successors.size();
i++) {
179 Ptr solver_node(
new SolverNodeSingleton(
181 graph_ptr->pathCost(state_, next_state, cost_),
184 solver_nodes.push_back(solver_node);
193 return std::vector<Ptr>();
196 std::vector<Ptr> parent_path = parent_->getPathWithoutThis();
197 parent_path.push_back(graph_->getNode(parent_));