|
Monte Carlo Integration Library 1.0
High-performance Monte Carlo methods for numerical integration and optimization
|
Drone arm center of mass optimization using PSO with high-precision verification. More...
#include <iostream>#include <vector>#include <cmath>#include <memory>#include <iomanip>#include <cstdint>#include <omp.h>#include <filesystem>#include <random>#include <limits>#include <functional>#include "../montecarlo/rng/rng_global.hpp"#include "../montecarlo/rng/rng_factory.hpp"#include "../montecarlo/geometry.hpp"#include "../montecarlo/integrators/MCintegrator.hpp"#include "../montecarlo/domains/hyperrectangle.hpp"#include "../montecarlo/domains/hypersphere.hpp"#include "../montecarlo/domains/hypercylinder.hpp"#include "../montecarlo/domains/polytope.hpp"#include "../montecarlo/optimizers/PSO.hpp"#include "../montecarlo/utils/plotter.hpp"#include <fstream>#include <stdexcept>Go to the source code of this file.
Classes | |
| class | DroneArmDomain |
Functions | |
| template<int dim> | |
| std::vector< mc::geom::Point< dim > > | read_points_from_file_drone (const std::string &filename) |
| template<int dim> | |
| void | read_normals_and_offsets_from_file_drone (const std::string &filename, std::vector< std::array< double, dim > > &normals, std::vector< double > &offsets) |
| uint32_t | hash_params (const std::vector< double > ¶ms) |
| double | objective_function (const std::vector< double > ¶ms) |
| int | main (int argc, char *argv[]) |
Variables | |
| constexpr size_t | DIM = 3 |
| Dimensionality of the problem space (3D geometry) | |
Drone arm center of mass optimization using PSO with high-precision verification.
This application demonstrates the use of Particle Swarm Optimization (PSO) combined with Monte Carlo integration to solve a geometric optimization problem: finding the optimal spherical hole placement in a drone arm to achieve a target center of mass position.
Problem Setup:
Implementation Highlights:
Performance:
Outputs:
Definition in file drone_optimization.cpp.
| uint32_t hash_params | ( | const std::vector< double > & | params | ) |
Definition at line 326 of file drone_optimization.cpp.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
| double objective_function | ( | const std::vector< double > & | params | ) |
| void read_normals_and_offsets_from_file_drone | ( | const std::string & | filename, |
| std::vector< std::array< double, dim > > & | normals, | ||
| std::vector< double > & | offsets | ||
| ) |
Definition at line 108 of file drone_optimization.cpp.
| std::vector< mc::geom::Point< dim > > read_points_from_file_drone | ( | const std::string & | filename | ) |
Definition at line 67 of file drone_optimization.cpp.
|
constexpr |
Dimensionality of the problem space (3D geometry)
Definition at line 61 of file drone_optimization.cpp.