7 #ifndef P3D_BASE_EXPANSION_HPP
8 #define P3D_BASE_EXPANSION_HPP
10 #include "API/ConfigSpace/configuration.hpp"
12 #include "../p3d/env.hpp"
67 void setDirectionMethod(
int directionExpansion) { m_ExpansionDirectionMethod = directionExpansion; }
77 void setNodeMethod(
int nodeExpansion) { m_ExpansionNodeMethod = nodeExpansion; }
108 return (pathLength == 0.) ? 1. : std::min(1., this->
step() / pathLength );
130 std::tr1::shared_ptr<Configuration> qf );
142 Node* directionNode,
unsigned& nbCreatedNodes);
153 std::tr1::shared_ptr<Configuration>& directionConfig,
155 std::tr1::shared_ptr<LocalPath>& newPath,
156 Env::expansionMethod method);
164 std::tr1::shared_ptr<LocalPath>& newPath,
165 Env::expansionMethod method);
176 std::tr1::shared_ptr<Configuration> getExpansionDirection(
Node* expandComp,
Node* goalComp,
177 bool samplePassive,
Node*& directionNode);
181 return m_last_added_node;
184 void addConnectibleNode(){
185 _nbConnectibleNodes++;
188 unsigned int getNbConnectibleNodes(){
189 return _nbConnectibleNodes;
194 int m_ExpansionNodeMethod;
195 int m_MaxExpandNodeFailure;
196 int m_kNearestPercent;
198 int m_ExpansionDirectionMethod;
199 bool m_IsDirSampleWithRlg;
203 Node* m_last_added_node;
208 unsigned int _nbConnectibleNodes;
void setToComp(Node *toComp)
Set the To Connected Component.
Definition: BaseExpansion.hpp:92
double positionAlongPath(LocalPath &path, double param)
Position on localpath in [0,1].
Definition: BaseExpansion.cpp:69
Classe représentant un Node d'un Graph.
Definition: node.hpp:39
void setDirectionMethod(int directionExpansion)
Set Expansion node Method.
Definition: BaseExpansion.hpp:67
Classe représentant un chemin local.
Definition: localpath.hpp:15
virtual Node * getExpansionNode(Node *compNode, confPtr_t direction, int distance)
Gets the nearest node in the graph.
Definition: BaseExpansion.cpp:253
void setFromComp(Node *fromComp)
Set the From Connected Component.
Definition: BaseExpansion.hpp:82
Node * getLasAddedNode()
Return last added node.
Definition: BaseExpansion.hpp:180
int getDirectionMethod()
Get Node Expansion Method.
Definition: BaseExpansion.hpp:62
int getNodeMethod()
Get Node Expansion Method.
Definition: BaseExpansion.hpp:72
The expansion class holds the method and local variables allowing to expand a Tree in a given configu...
Definition: BaseExpansion.hpp:34
~BaseExpansion()
Destructor.
Definition: BaseExpansion.cpp:48
Node * getFromComp()
Get the From Connected Component.
Definition: BaseExpansion.hpp:87
void setGraph(Graph *G)
Set the graph that is beeing expanded.
Definition: BaseExpansion.hpp:52
void setNodeMethod(int nodeExpansion)
Set Expansion node Method.
Definition: BaseExpansion.hpp:77
LocalPath getExtensiontPath(std::tr1::shared_ptr< Configuration > qi, std::tr1::shared_ptr< Configuration > qf)
Computes a localpath parameter used for expansion of at max step() of length.
Definition: BaseExpansion.cpp:91
virtual Node * addNode(Node *currentNode, LocalPath &path, double pathDelta, Node *directionNode, unsigned &nbCreatedNodes)
Adds a node to a connected component.
Definition: BaseExpansion.cpp:235
double step()
Expansion Step (Delta)
Definition: BaseExpansion.cpp:53
double computeInterpolationFactor(double pathLength)
Compute the interpolation factor along the path, based on the extension step.
Definition: BaseExpansion.hpp:107
confPtr_t interpolate(confPtr_t conf, LocalPath *path, double factor)
Interpolation along the given path.
Definition: BaseExpansion.cpp:64
double pathDelta(LocalPath &path)
Return the path parameter that is the closest to step()
Definition: BaseExpansion.cpp:79
Node * getToComp()
Get the To Connected Component.
Definition: BaseExpansion.hpp:97
void expansionFailed(Node &node)
Function called when a node can not be connected.
Definition: BaseExpansion.cpp:140
bool nextStep(LocalPath &path, std::tr1::shared_ptr< Configuration > &directionConfig, double &pathDelta, std::tr1::shared_ptr< LocalPath > &newPath, Env::expansionMethod method)
Returns a valid configuration on the local path.
Graph * getGraph()
Get the graph that is beeing expanded.
Definition: BaseExpansion.hpp:57
BaseExpansion()
Constructor.
Definition: BaseExpansion.cpp:21
bool refinementControl(LocalPath &path, double rho, Node &compNode)
Function that balances the ratio of exploration towards refinement.
Definition: BaseExpansion.cpp:105