|
bitsim
Model, simulate, estimate and control robots in C++
|
Classes | |
| struct | Run |
Typedefs | |
| using | real_t |
| real_t | |
| using | uint_t |
| uint_t | |
Functions | |
| MultiAgentGridWorld | make_env (GridObservation observation) |
| Run | train (GridObservation observation, uint_t seed, uint_t n_episodes) |
| Run | train_one (std::size_t k, uint_t n_seeds, uint_t n_episodes) |
| void | summarise (const std::string &name, const std::vector< Run > &runs) |
| void | write_returns (const std::vector< Run > &own, const std::vector< Run > &joint) |
| void | show (const Run &run, GridObservation observation) |
| void | run (uint_t n_episodes, uint_t n_seeds) |
| template<typename F> | |
| auto | parallel_map (std::size_t n, F &&f, ThreadPool &pool=default_thread_pool()) -> std::vector< std::invoke_result_t< F &, std::size_t > > |
| Compute f(0), f(1), ..., f(n - 1) on the threads of pool. | |
| using bitsim::real_t |
| using bitsim::uint_t |
| MultiAgentGridWorld multi_agent_grid_world::make_env | ( | GridObservation | observation | ) |
| auto bitsim::utils::concurrency::parallel_map | ( | std::size_t | n, |
| F && | f, | ||
| ThreadPool & | pool = default_thread_pool() )->std::vector< std::invoke_result_t< F &, std::size_t > > |
Compute f(0), f(1), ..., f(n - 1) on the threads of pool.
The results come back in the order of their index, whatever order the threads finish in, so the output does not depend on the number of threads. A typical use is to run one simulation or one training per seed or per parameter value. The rules of parallel_for() apply.
| void multi_agent_grid_world::show | ( | const Run & | run, |
| GridObservation | observation ) |
| void multi_agent_grid_world::summarise | ( | const std::string & | name, |
| const std::vector< Run > & | runs ) |
| Run multi_agent_grid_world::train | ( | GridObservation | observation, |
| uint_t | seed, | ||
| uint_t | n_episodes ) |