DART  6.7.3
PagmoMultiObjectiveSolver.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2019, 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  {
56  };
57 
59  {
62 
65  };
66 
68  {
69  Properties(
70  const MultiObjectiveSolver::Properties& solverProperties
72  const UniqueProperties& descentProperties = UniqueProperties());
73  };
74 
77  const Properties& properties = Properties());
78 
81  std::shared_ptr<MultiObjectiveProblem> problem);
82 
84  ~PagmoMultiObjectiveSolver() override;
85 
86  // Documentation inherited
87  bool solve(std::size_t numEvolutions = 1u) override;
88 
89  // Documentation inherited
90  std::string getType() const override;
91 
92  // Documentation inherited
93  std::shared_ptr<MultiObjectiveSolver> clone() const override;
94 
96  void setProperties(const Properties& properties);
97 
100 
103 
105  void copy(const PagmoMultiObjectiveSolver& other);
106 
109 
111  void setAlgorithm(Algorithm alg);
112 
114  Algorithm getAlgorithm() const;
115 
116 protected:
119 
121  std::uniform_real_distribution<double> mDistribution;
122 };
123 
124 } // namespace optimizer
125 } // namespace dart
126 
127 #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:141
void setProperties(const Properties &properties)
Sets the Properties of this PagmoMultiObjectiveSolver.
Definition: PagmoMultiObjectiveSolver.cpp:182
std::uniform_real_distribution< double > mDistribution
Distribution.
Definition: PagmoMultiObjectiveSolver.hpp:121
PagmoMultiObjectiveSolver & operator=(const PagmoMultiObjectiveSolver &other)
Copies the Properties of another PagmoMultiObjectiveSolver.
Definition: PagmoMultiObjectiveSolver.cpp:209
UniqueProperties mPagmoMultiObjectiveSolverP
PagmoMultiObjectiveSolver properties.
Definition: PagmoMultiObjectiveSolver.hpp:118
Algorithm getAlgorithm() const
Returns the algorithm that is to be used by the pagmo solver.
Definition: PagmoMultiObjectiveSolver.cpp:223
void copy(const PagmoMultiObjectiveSolver &other)
Copies the Properties of another PagmoMultiObjectiveSolver.
Definition: PagmoMultiObjectiveSolver.cpp:203
std::string getType() const override
Returns the type (implementation) of this Solver.
Definition: PagmoMultiObjectiveSolver.cpp:170
Properties getGradientDescentProperties() const
Returns the Properties of this GradientDescentSolver.
Definition: PagmoMultiObjectiveSolver.cpp:197
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:176
void setAlgorithm(Algorithm alg)
Sets the algorithm that is to be used by the solver.
Definition: PagmoMultiObjectiveSolver.cpp:217
Definition: BulletCollisionDetector.cpp:63
The MultiObjectiveSolver::Properties class contains Solver parameters that are common to all MultiObj...
Definition: MultiObjectiveSolver.hpp:65
Definition: PagmoMultiObjectiveSolver.hpp:68
Properties(const MultiObjectiveSolver::Properties &solverProperties=MultiObjectiveSolver::Properties(), const UniqueProperties &descentProperties=UniqueProperties())
Definition: PagmoMultiObjectiveSolver.cpp:57
Definition: PagmoMultiObjectiveSolver.hpp:59
Algorithm mAlgorithm
Algorithm to be used by the pagmo.
Definition: PagmoMultiObjectiveSolver.hpp:61
UniqueProperties(Algorithm algorithm=Algorithm::Global_NSGA2)
Constructor.
Definition: PagmoMultiObjectiveSolver.cpp:49