To use the template, a class must be derived from CAStarAlgorithm<Solution Class>.
In this case, the Solution Class is CCoinDistribution.
Definition at line 65 of file vision_stereo_rectify/test.cpp.
Public Member Functions | |
CAStarExample (size_t goal) | |
When a class derives from CAStarAlgorithm, its constructor should include all the data that define the specific problem. More... | |
virtual bool | isSolutionEnded (const CCoinDistribution &s) |
The following five methods must be implemented to use the algorithm: More... | |
virtual bool | isSolutionValid (const CCoinDistribution &s) |
Client code must implement this method. More... | |
virtual void | generateChildren (const CCoinDistribution &s, vector< CCoinDistribution > &sols) |
Client code must implement this method. More... | |
virtual double | getHeuristic (const CCoinDistribution &s) |
Client code must implement this method. More... | |
virtual double | getCost (const CCoinDistribution &s) |
Client code must implement this method. More... | |
int | getOptimalSolution (const CCoinDistribution &initialSol, CCoinDistribution &finalSol, double upperLevel=HUGE_VAL, double maxComputationTime=HUGE_VAL) |
Finds the optimal solution for a problem, using the A* algorithm. More... | |
Private Member Functions | |
double | getTotalCost (const CCoinDistribution &sol) |
Calculates the total cost (known+estimated) of a solution. More... | |
Private Attributes | |
const size_t | N |
Problem goal. More... | |
|
inline |
When a class derives from CAStarAlgorithm, its constructor should include all the data that define the specific problem.
Definition at line 78 of file vision_stereo_rectify/test.cpp.
|
inlinevirtual |
Client code must implement this method.
Given a partial solution, returns all its children solution, regardless of their validity or completeness.
Implements mrpt::graphs::CAStarAlgorithm< CCoinDistribution >.
Definition at line 90 of file vision_stereo_rectify/test.cpp.
|
inlinevirtual |
Client code must implement this method.
Given a (possibly partial) solution, calculates its cost so far. This cost must not decrease with each step. That is, a solution cannot have a smaller cost than the previous one from which it was generated.
Implements mrpt::graphs::CAStarAlgorithm< CCoinDistribution >.
Definition at line 108 of file vision_stereo_rectify/test.cpp.
|
inlinevirtual |
Client code must implement this method.
Given a partial solution, estimates the cost of the remaining (unknown) part. This cost must always be greater or equal to zero, and not greater than the actual cost. Thus, must be 0 if the solution is complete.
Implements mrpt::graphs::CAStarAlgorithm< CCoinDistribution >.
Definition at line 102 of file vision_stereo_rectify/test.cpp.
|
inlineinherited |
Finds the optimal solution for a problem, using the A* algorithm.
Returns whether an optimal solution was actually found. Returns 0 if no solution was found, 1 if an optimal solution was found and 2 if a (possibly suboptimal) solution was found but the time lapse ended.
Definition at line 94 of file CAStarAlgorithm.h.
|
inlineprivateinherited |
Calculates the total cost (known+estimated) of a solution.
Definition at line 81 of file CAStarAlgorithm.h.
|
inlinevirtual |
The following five methods must be implemented to use the algorithm:
Implements mrpt::graphs::CAStarAlgorithm< CCoinDistribution >.
Definition at line 82 of file vision_stereo_rectify/test.cpp.
|
inlinevirtual |
Client code must implement this method.
Returns true if the given solution is acceptable, that is, doesn't violate the problem logic.
Implements mrpt::graphs::CAStarAlgorithm< CCoinDistribution >.
Definition at line 86 of file vision_stereo_rectify/test.cpp.
|
private |
Problem goal.
Definition at line 71 of file vision_stereo_rectify/test.cpp.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |