DART  6.10.1
PagmoMultiObjectiveSolver.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_OPTIMIZER_PAGMO_PAGMOMULTIOBJECTIVESOLVER_HPP_
34 #define DART_OPTIMIZER_PAGMO_PAGMOMULTIOBJECTIVESOLVER_HPP_
35 
36 #include <random>
37 #include <pagmo/pagmo.hpp>
39 
40 #define DART_PAGMO_DEFAULT_SOLVER Algorithm::Global_MOEAD
41 
42 namespace dart {
43 namespace optimizer {
44 
45 class MultiObjectiveProblem;
46 
48 {
49 public:
51  enum class Algorithm
52  {
53 #ifdef PAGMO_WITH_NLOPT
54  Local_nlopt_COBYLA,
55 #endif
58  };
59 
61  {
64 
67  };
68 
70  {
71  Properties(
72  const MultiObjectiveSolver::Properties& solverProperties
74  const UniqueProperties& descentProperties = UniqueProperties());
75  };
76 
79  const Properties& properties = Properties());
80 
83  std::shared_ptr<MultiObjectiveProblem> problem);
84 
86  ~PagmoMultiObjectiveSolver() override;
87 
88  // Documentation inherited
89  bool solve(std::size_t numEvolutions = 1u) override;
90 
91  // Documentation inherited
92  std::string getType() const override;
93 
94  // Documentation inherited
95  std::shared_ptr<MultiObjectiveSolver> clone() const override;
96 
98  void setProperties(const Properties& properties);
99 
102 
105 
107  void copy(const PagmoMultiObjectiveSolver& other);
108 
111 
113  void setAlgorithm(Algorithm alg);
114 
116  Algorithm getAlgorithm() const;
117 
118 protected:
121 
123  std::uniform_real_distribution<double> mDistribution;
124 };
125 
126 } // namespace optimizer
127 } // namespace dart
128 
129 #endif // DART_OPTIMIZER_PAGMO_PAGMOMULTIOBJECTIVESOLVER_HPP_
BodyPropPtr properties
Definition: SdfParser.cpp:80
Abstract class that provides a common interface for different multi-objective optimization solvers.
Definition: MultiObjectiveSolver.hpp:58
Definition: PagmoMultiObjectiveSolver.hpp:48
bool solve(std::size_t numEvolutions=1u) override
Solve optimization problem.
Definition: PagmoMultiObjectiveSolver.cpp:145
void setProperties(const Properties &properties)
Sets the Properties of this PagmoMultiObjectiveSolver.
Definition: PagmoMultiObjectiveSolver.cpp:186
std::uniform_real_distribution< double > mDistribution
Distribution.
Definition: PagmoMultiObjectiveSolver.hpp:123
PagmoMultiObjectiveSolver & operator=(const PagmoMultiObjectiveSolver &other)
Copies the Properties of another PagmoMultiObjectiveSolver.
Definition: PagmoMultiObjectiveSolver.cpp:213
UniqueProperties mPagmoMultiObjectiveSolverP
PagmoMultiObjectiveSolver properties.
Definition: PagmoMultiObjectiveSolver.hpp:120
Algorithm getAlgorithm() const
Returns the algorithm that is to be used by the pagmo solver.
Definition: PagmoMultiObjectiveSolver.cpp:227
void copy(const PagmoMultiObjectiveSolver &other)
Copies the Properties of another PagmoMultiObjectiveSolver.
Definition: PagmoMultiObjectiveSolver.cpp:207
std::string getType() const override
Returns the type (implementation) of this Solver.
Definition: PagmoMultiObjectiveSolver.cpp:174
Properties getGradientDescentProperties() const
Returns the Properties of this GradientDescentSolver.
Definition: PagmoMultiObjectiveSolver.cpp:201
PagmoMultiObjectiveSolver(const Properties &properties=Properties())
Default Constructor.
Definition: PagmoMultiObjectiveSolver.cpp:67
~PagmoMultiObjectiveSolver() override
Destructor.
Definition: PagmoMultiObjectiveSolver.cpp:83
Algorithm
Reference: https://esa.github.io/pagmo2/docs/algorithm_list.html.
Definition: PagmoMultiObjectiveSolver.hpp:52
std::shared_ptr< MultiObjectiveSolver > clone() const override
Creates an identical clone of this Solver.
Definition: PagmoMultiObjectiveSolver.cpp:180
void setAlgorithm(Algorithm alg)
Sets the algorithm that is to be used by the solver.
Definition: PagmoMultiObjectiveSolver.cpp:221
Definition: BulletCollisionDetector.cpp:65
The MultiObjectiveSolver::Properties class contains Solver parameters that are common to all MultiObj...
Definition: MultiObjectiveSolver.hpp:65
Definition: PagmoMultiObjectiveSolver.hpp:70
Properties(const MultiObjectiveSolver::Properties &solverProperties=MultiObjectiveSolver::Properties(), const UniqueProperties &descentProperties=UniqueProperties())
Definition: PagmoMultiObjectiveSolver.cpp:57
Definition: PagmoMultiObjectiveSolver.hpp:61
Algorithm mAlgorithm
Algorithm to be used by the pagmo.
Definition: PagmoMultiObjectiveSolver.hpp:63
UniqueProperties(Algorithm algorithm=Algorithm::Global_NSGA2)
Constructor.
Definition: PagmoMultiObjectiveSolver.cpp:49