Benchmark a set of planners on a problem instance. More...
#include <Benchmark.h>
Classes | |
struct | CompleteExperiment |
This structure holds experimental data for a set of planners. More... | |
struct | PlannerExperiment |
The data collected after running a planner multiple times. More... | |
struct | Status |
This structure contains information about the activity of a benchmark instance. If the instance is running, it is possible to find out information such as which planner is currently being tested or how much. More... | |
Public Types | |
typedef std::map< std::string, std::string > | RunProperties |
The data collected from a run of a planner is stored as key-value pairs. | |
typedef boost::function1< void, const base::PlannerPtr & > | PreSetupEvent |
Signature of function that can be called before a planner execution is started. | |
typedef boost::function2< void, const base::PlannerPtr &, RunProperties & > | PostSetupEvent |
Signature of function that can be called after a planner execution is completed. | |
Public Member Functions | |
Benchmark (geometric::SimpleSetup &setup, const std::string &name=std::string()) | |
Constructor needs the SimpleSetup instance needed for planning. Optionally, the experiment name (name) can be specified. | |
Benchmark (control::SimpleSetup &setup, const std::string &name=std::string()) | |
Constructor needs the SimpleSetup instance needed for planning. Optionally, the experiment name (name) can be specified. | |
void | setExperimentName (const std::string &name) |
Set the name of the experiment. | |
const std::string & | getExperimentName (void) const |
Get the name of the experiment. | |
void | addPlanner (const base::PlannerPtr &planner) |
Set the planner to use. If the planner is not set, an attempt is made to use the planner allocator. If no planner allocator is available either, a default planner is set. | |
void | addPlannerAllocator (const base::PlannerAllocator &pa) |
Set the planner allocator to use. This is only used if no planner has been set. This is optional -- a default planner will be used if no planner is otherwise specified. | |
void | clearPlanners (void) |
Clear the set of planners to be benchmarked. | |
void | setPreRunEvent (const PreSetupEvent &event) |
Set the event to be called before the run of a planner. | |
void | setPostRunEvent (const PostSetupEvent &event) |
Set the event to be called after the run of a planner. | |
virtual void | benchmark (double maxTime, double maxMem, unsigned int runCount, bool displayProgress=false) |
Benchmark the added planners on the defined problem. Repeated calls clear previously gathered data. | |
const Status & | getStatus (void) const |
Get the status of the benchmarking code. This function can be called in a separate thread to check how much progress has been made. | |
const CompleteExperiment & | getRecordedExperimentData (void) const |
Return all the experiment data that would be written to the results file. The data should not be changed, but it could be useful to quickly extract cartain statistics. | |
virtual bool | saveResultsToStream (std::ostream &out=std::cout) const |
Save the results of the benchmark to a stream. | |
bool | saveResultsToFile (const char *filename) const |
Save the results of the benchmark to a file. | |
bool | saveResultsToFile (void) const |
Save the results of the benchmark to a file. The name of the file is the current date and time. | |
Protected Attributes | |
geometric::SimpleSetup * | gsetup_ |
The instance of the problem to benchmark (if geometric planning) | |
control::SimpleSetup * | csetup_ |
The instance of the problem to benchmark (if planning with controls) | |
std::vector< base::PlannerPtr > | planners_ |
The set of planners to be tested. | |
CompleteExperiment | exp_ |
The collected experimental data (for all planners) | |
Status | status_ |
The current status of this benchmarking instance. | |
PreSetupEvent | preRun_ |
Event to be called before the run of a planner. | |
PostSetupEvent | postRun_ |
Event to be called after the run of a planner. | |
msg::Interface | msg_ |
Interface for console output. |
Benchmark a set of planners on a problem instance.
Definition at line 47 of file Benchmark.h.
void ompl::Benchmark::benchmark | ( | double | maxTime, |
double | maxMem, | ||
unsigned int | runCount, | ||
bool | displayProgress = false |
||
) | [virtual] |
Benchmark the added planners on the defined problem. Repeated calls clear previously gathered data.
maxTime | the maximum amount of time a planner is allowed to run (seconds) |
maxMem | the maximum amount of memory a planner is allowed to use (MB) |
runCount | the number of times to run each planner |
displayProgress | flag indicating whether progress is to be displayed or not |
Definition at line 262 of file Benchmark.cpp.