dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
AbstractDomain.h
Go to the documentation of this file.
1 
12 #ifndef DIGNEA_EIGPROBLEM_H
13 #define DIGNEA_EIGPROBLEM_H
14 
15 #include <dignea/core/Problem.h>
16 
27 template <typename OptProblem, typename InstSolution>
28 class AbstractDomain : public Problem<InstSolution> {
29  public:
31 
32  AbstractDomain(const int &numberOfVars, const int &numberOfObjectives,
33  const int &nCons);
34 
35  virtual ~AbstractDomain() = default;
36 
44  virtual shared_ptr<OptProblem> genOptProblem(
45  const InstSolution &instance) const = 0;
46 
55  virtual int getOptimizationDirection(const int i) const {
56  return Maximize;
57  };
58 
66  virtual vector<InstSolution> createSolutions(
67  const int &maxSolutions) const = 0;
68 
74  virtual void beforeEvaluation(vector<InstSolution> &) = 0;
79  virtual void afterEvaluation(vector<InstSolution> &) = 0;
80 
81  protected:
82  int internalDimension;
83 };
84 
92 template <typename OptProblem, typename InstSolution>
94  : Problem<InstSolution>(), internalDimension(-1) {}
95 
108 template <typename OptProblem, typename InstSolution>
110  const int &numberOfVars, const int &numberOfObjectives, const int &nCons)
111  : Problem<InstSolution>(numberOfVars, numberOfObjectives, nCons),
112  internalDimension(-1) {}
113 
114 #endif // DIGNEA_EIGPROBLEM_H
EIG Instance Generation Problem. Abstract Problem for the EIG. This problem will be used as a supercl...
Definition: AbstractDomain.h:28
AbstractDomain(const int &numberOfVars, const int &numberOfObjectives, const int &nCons)
Construct a new AbstractDomain<OptProblem, InstSolution>AbstractDomain object.
Definition: AbstractDomain.h:109
virtual int getOptimizationDirection(const int i) const
Returns the optimization direction for each objective in the problem. It returns Minimize or Maximize...
Definition: AbstractDomain.h:55
virtual void afterEvaluation(vector< InstSolution > &)=0
Method to apply operations to the instances after evaluate them This is problem dependent.
AbstractDomain()
Construct a new AbstractDomain<OptProblem, InstSolution>AbstractDomain object.
Definition: AbstractDomain.h:93
virtual shared_ptr< OptProblem > genOptProblem(const InstSolution &instance) const =0
Generates a shared_ptr to an optimisation problem represented in the InstSolution given as a paramete...
virtual vector< InstSolution > createSolutions(const int &maxSolutions) const =0
Generates and returns a vector of InstSolutions. Instances of the optimisation problem.
virtual void beforeEvaluation(vector< InstSolution > &)=0
Method to apply operations to the instances before evaluate them This is problem dependent.
Class to represent a Problem in the tool. It includes the basic information for a problem a few metho...
Definition: Problem.h:29
int numberOfVars
Definition: Problem.h:155