|
def | __init__ (self, client, robot, problemSolver) |
|
def | do |
| Solve the same problem for the specified cases, for various random seed. More...
|
|
def | getCase (self, iter) |
|
def | writeResume (self, filename=None) |
| Write data to file. More...
|
|
def | tryResumeAndDelete (self, filename=None) |
| In case of crash of HPP, the benchmark class writes temporary datas to a file. More...
|
|
def | resumeFrom (self, fname) |
|
def | plotTime (self, axes) |
|
def | plotPathLength (self, axes) |
|
def | writeDatabase (self, nameDatabase, experimentName='default', nameLogFile='temp.log', append=False) |
| This method create a database which store the benchmark results. More...
|
|
def | __str__ (self) |
|
class to do benchmarking
Basic usage
...
benchmark = Benchmark (robot.client, robot, ps)
benchmark.iterPerCase = 10
results = benchmark.do()
- See also
- hpp.corbaserver.benchmark.Benchmark.do hpp.corbaserver.benchmark.Benchmark.seedRange
If you wish to replot datas stored in a file:
import matplotlib.pyplot as plt
b = Benchmark (None, None, None)
b.resumeFrom ("datafile")
fig, axes = plt.subplots(nrows=1, ncols=2)
b.plotTime (axes[0])
b.plotPathLength (axes[1])
plt.show ()
- See also
- hpp.corbaserver.benchmark.Benchmark.plotTime hpp.corbaserver.benchmark.Benchmark.plotPathLength
Advanced usage
b = Benchmark (robot.client, robot, ps)
b.seedRange = range (10)
b.iterPerCase = 10
b.cases = list()
for type in ["Progressive", "Global"]:
for param in [0.1, 0.2]:
b.cases.append((type,param))
b.cases.append(("None",0.1))
b.tryResumeAndDelete ()
def initialize (bench, case, iter):
bench.ps.selectPathProjector (case[0], case[1])
results = b.do(initCase = initialize)
- See also
- hpp.corbaserver.benchmark.Benchmark.cases hpp.corbaserver.benchmark.Benchmark.iterPerCase hpp.corbaserver.benchmark.Benchmark.tryResumeAndDelete
What if HPP crashes
- Note
- This section assumes you have installed https://github.com/humanoid-path-planner/hpp-tools
You can do the following
try:
b.do ()
except:
import sys
sys.exit(1)
b.writeResume (filename = "yourresults")
Then, launch your server with this:
hppautorestart hppcorbaserver
Finally, launch your script with this:
hpp_run_benchmark path_to_python_script_file.py
This will restart the server whenever it crashes and will resume the benchmarks where it stopped.