MAiNGO
MAiNGOmodelEpsCon.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2019 Process Systems Engineering (AVT.SVT), RWTH Aachen University
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0.
7  *
8  * SPDX-License-Identifier: EPL-2.0
9  *
10  * @file MAiNGOmodelEpsCon.h
11  *
12  * @brief File containing declaration of the MAiNGOmodelEpsCon class,
13  * which specializes the MAiNGOmodel class for bi-objective problems
14  * to be solved with the epsilon-constraint method.
15  *
16  **********************************************************************************/
17 
18 #pragma once
19 
20 #include "MAiNGOmodel.h"
21 
22 
27 namespace maingo {
28 
29 
37 
38  public:
42  virtual ~MAiNGOmodelEpsCon() {}
43 
49  virtual EvaluationContainer evaluate_user_model(const std::vector<Var> &optVars) = 0;
50 
54  virtual std::vector<OptimizationVariable> get_variables() = 0;
55 
61  EvaluationContainer evaluate(const std::vector<Var> &optVars) final;
62 
66  virtual std::vector<double> get_initial_point() { return std::vector<double>(); }
67 
73  void set_epsilon(const std::vector<double> &epsilon)
74  {
75  _epsilon = epsilon;
76  }
77 
83  void set_objective_index(const size_t objectiveIndex)
84  {
85  _objectiveIndex = objectiveIndex;
86  }
87 
93  void set_single_objective(bool singleObjective)
94  {
95  _singleObjective = singleObjective;
96  }
97 
98  private:
99  std::vector<double> _epsilon;
101  bool _singleObjective = true;
102 };
103 
104 
105 } // end namespace maingo
void set_single_objective(bool singleObjective)
Function for setting the _singleObjective flag.
Definition: MAiNGOmodelEpsCon.h:93
This class is the base class for implementing bi-objective problems.
Definition: MAiNGOmodelEpsCon.h:36
bool _singleObjective
Definition: MAiNGOmodelEpsCon.h:101
EvaluationContainer evaluate(const std::vector< Var > &optVars) final
Virtual function which has to be implemented by the user in order to enable evaluation of the model.
Definition: MAiNGOmodelEpsCon.cpp:33
virtual std::vector< double > get_initial_point()
Virtual function which has to be implemented by the user in order to enable getting data on the initi...
Definition: MAiNGOmodelEpsCon.h:66
Struct for storing the values returned by model evaluation at the given point "var".
Definition: evaluationContainer.h:192
virtual EvaluationContainer evaluate_user_model(const std::vector< Var > &optVars)=0
Virtual function which has to be implemented by the user in order to enable evaluation of the model.
This class is the base class for models to be solved by MAiNGO.
Definition: MAiNGOmodel.h:91
void set_epsilon(const std::vector< double > &epsilon)
Function for changing the epsilon-parameters.
Definition: MAiNGOmodelEpsCon.h:73
size_t _objectiveIndex
Definition: MAiNGOmodelEpsCon.h:100
namespace holding all essentials of MAiNGO
Definition: aleModel.h:31
virtual ~MAiNGOmodelEpsCon()
Destructor.
Definition: MAiNGOmodelEpsCon.h:42
virtual std::vector< OptimizationVariable > get_variables()=0
Virtual function which has to be implemented by the user in order to enable getting data on optimizat...
std::vector< double > _epsilon
Definition: MAiNGOmodelEpsCon.h:99
void set_objective_index(const size_t objectiveIndex)
Function for setting the objective index.
Definition: MAiNGOmodelEpsCon.h:83