Loading...
Searching...
No Matches
Benchmark.cpp
85 runThread(planner, memStart + maxMem, time::seconds(maxTime), time::seconds(timeBetweenUpdates));
208void ompl::tools::Benchmark::addExperimentParameter(const std::string &name, const std::string &type,
214const std::map<std::string, std::string> &ompl::tools::Benchmark::getExperimentParameters() const
522 std::cout << "Each planner will be executed " << req.runCount << " times for at most " << req.maxTime
542 OMPL_INFORM("Executing planner-switch event for planner %s ...", status_.activePlanner.c_str());
550 es << "There was an error executing the planner-switch event for planner " << status_.activePlanner
569 std::sort(exp_.planners[i].progressPropertyNames.begin(), exp_.planners[i].progressPropertyNames.end());
578 req.runCount ? (double)(100 * (req.runCount * i + j)) / (double)(planners_.size() * req.runCount) :
626 es << "There was an error executing the pre-run event for run " << status_.activeRun << " of planner "
644 run["status ENUM"] = std::to_string((int)static_cast<base::PlannerStatus::StatusType>(rp.getStatus()));
710 run["solution segments INTEGER"] = std::to_string(csetup_->getSolutionPath().getControlCount());
715 base::PlannerData pd(gsetup_ ? gsetup_->getSpaceInformation() : csetup_->getSpaceInformation());
756 es << "There was an error in the extraction of planner results: planner = " << status_.activePlanner
static std::uint_fast32_t getSeed()
Get the seed used to generate the seeds of each RNG instance. Passing the returned value to setSeed()...
Definition RandomNumbers.cpp:209
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique,...
Definition PlannerData.h:175
unsigned int numEdges() const
Retrieve the number of edges in this structure.
Definition PlannerData.cpp:205
unsigned int numVertices() const
Retrieve the number of vertices in this structure.
Definition PlannerData.cpp:200
std::map< std::string, std::string > properties
Any extra properties (key-value pairs) the planner can set.
Definition PlannerData.h:410
std::map< std::string, PlannerProgressProperty > PlannerProgressProperties
A dictionary which maps the name of a progress property to the function to be used for querying that ...
Definition Planner.h:353
Create the set of classes typically needed to solve a control problem.
Definition SimpleSetup.h:63
Create the set of classes typically needed to solve a geometric problem.
Definition SimpleSetup.h:63
Implementation of OutputHandler that saves messages in a file.
Definition Console.h:126
Generic class to handle output from a piece of code.
Definition Console.h:103
Definition Time.h:88
PreSetupEvent plannerSwitch_
Event to be called when the evaluated planner is switched.
Definition Benchmark.h:288
std::function< void(const base::PlannerPtr &)> PreSetupEvent
Signature of function that can be called before a planner execution is started.
Definition Benchmark.h:79
const std::map< std::string, std::string > & getExperimentParameters() const
Get all optional benchmark parameters. The map key is 'name type'.
Definition Benchmark.cpp:214
virtual void benchmark(const Request &req)
Benchmark the added planners on the defined problem. Repeated calls clear previously gathered data.
Definition Benchmark.cpp:433
const Status & getStatus() const
Get the status of the benchmarking code. This function can be called in a separate thread to check ho...
Definition Benchmark.cpp:269
std::vector< base::PlannerPtr > planners_
The set of planners to be tested.
Definition Benchmark.h:279
void setPreRunEvent(const PreSetupEvent &event)
Set the event to be called before the run of a planner.
Definition Benchmark.cpp:258
const std::string & getExperimentName() const
Get the name of the experiment.
Definition Benchmark.cpp:229
void setExperimentName(const std::string &name)
Set the name of the experiment.
Definition Benchmark.cpp:224
void setPlannerSwitchEvent(const PreSetupEvent &event)
Set the event to be called before any runs of a particular planner (when the planner is switched).
Definition Benchmark.cpp:252
CompleteExperiment exp_
The collected experimental data (for all planners).
Definition Benchmark.h:282
control::SimpleSetup * csetup_
The instance of the problem to benchmark (if planning with controls).
Definition Benchmark.h:276
std::function< void(const base::PlannerPtr &, RunProperties &)> PostSetupEvent
Signature of function that can be called after a planner execution is completed.
Definition Benchmark.h:82
geometric::SimpleSetup * gsetup_
The instance of the problem to benchmark (if geometric planning).
Definition Benchmark.h:273
void setPostRunEvent(const PostSetupEvent &event)
Set the event to be called after the run of a planner.
Definition Benchmark.cpp:264
void addPlannerAllocator(const base::PlannerAllocator &pa)
Add a planner allocator to use.
Definition Benchmark.cpp:242
std::size_t numExperimentParameters() const
Return the number of optional benchmark parameters.
Definition Benchmark.cpp:219
bool saveResultsToFile() const
Save the results of the benchmark to a file. The name of the file is the current date and time.
Definition Benchmark.cpp:300
virtual bool saveResultsToStream(std::ostream &out=std::cout) const
Save the results of the benchmark to a stream.
Definition Benchmark.cpp:306
const CompleteExperiment & getRecordedExperimentData() const
Return all the experiment data that would be written to the results file. The data should not be chan...
Definition Benchmark.cpp:274
bool saveResultsToFile(const char *filename) const
Save the results of the benchmark to a file.
Definition Benchmark.cpp:279
Benchmark(geometric::SimpleSetup &setup, const std::string &name=std::string())
Constructor needs the SimpleSetup instance needed for planning. Optionally, the experiment name (name...
Definition Benchmark.cpp:196
void addExperimentParameter(const std::string &name, const std::string &type, const std::string &value)
Add an optional parameter's information to the benchmark output. Useful for aggregating results over ...
Definition Benchmark.cpp:208
std::function< PlannerPtr(const SpaceInformationPtr &)> PlannerAllocator
Definition of a function that can allocate a planner.
Definition Planner.h:428
std::function< bool()> PlannerTerminationConditionFn
Signature for functions that decide whether termination conditions have been met for a planner,...
Definition PlannerTerminationCondition.h:56
MemUsage_t getProcessMemoryUsage()
Get the amount of memory the current process is using. This should work on major platforms (Windows,...
std::string getCPUInfo()
Get information about the CPU of the machine in use.
OutputHandler * getOutputHandler()
Get the instance of the OutputHandler currently used. This is nullptr in case there is no output hand...
Definition Console.cpp:115
void useOutputHandler(OutputHandler *oh)
Specify the instance of the OutputHandler to use. By default, this is OutputHandlerSTD.
Definition Console.cpp:108
void noOutputHandler()
This function instructs ompl that no messages should be outputted. Equivalent to useOutputHandler(nul...
Definition Console.cpp:95
duration seconds(double sec)
Return the time duration representing a given number of seconds.
Definition Time.h:64
std::string as_string(const point &p)
Return string representation of point in time.
Definition Time.h:78
Includes various tools such as self config, benchmarking, etc.
Definition LightningRetrieveRepair.h:48
Main namespace. Contains everything in this library.
Definition MultiLevelPlanarManipulatorDemo.cpp:66
std::string toString(float val)
convert float to string using classic "C" locale semantics
Definition String.cpp:82
A class to store the exit status of Planner::solve().
Definition PlannerStatus.h:49
This structure holds experimental data for a set of planners.
Definition Benchmark.h:112
unsigned int runCount
the number of times to run each planner; 100 by default If set to 0, then run each planner as many ti...
Definition Benchmark.h:175
bool displayProgress
flag indicating whether progress is to be displayed or not; true by default
Definition Benchmark.h:182
double maxMem
the maximum amount of memory a planner is allowed to use (MB); 4096.0 by default
Definition Benchmark.h:171
double timeBetweenUpdates
When collecting time-varying data from a planner during its execution, the planner's progress will be...
Definition Benchmark.h:179
bool saveConsoleOutput
flag indicating whether console output is saved (in an automatically generated filename); true by def...
Definition Benchmark.h:186
double maxTime
the maximum amount of time a planner is allowed to run (seconds); 5.0 by default
Definition Benchmark.h:168
bool simplify
flag indicating whether simplification should be applied to path; true by default
Definition Benchmark.h:189
The data collected from a run of a planner is stored as key-value pairs.
Definition Benchmark.h:73
This structure contains information about the activity of a benchmark instance. If the instance is ru...
Definition Benchmark.h:56