|
| Problem () |
| Creates a new Problem with all parameters to zero. More...
|
|
| Problem (const int &numberOfVars, const int &numberOfObjectives, const int &nCons) |
| Construct a new Problem with all the given parameters. More...
|
|
| Problem (const Problem *copy) |
|
virtual bool | evaluateConstraints (S &sol) const =0 |
| Method to evaluate whether a solution is feasible or not. This method must be implemented in the subclasses. More...
|
|
virtual void | evaluate (S &sol) const =0 |
| Method to evaluate a solution using the proper problem formulation. This method must be implemented in the subclasses. More...
|
|
virtual S | createSolution () const =0 |
| Creates a new solution for the problem. Usually uses problem information and generates a solution randomly. This method must be implemented in the subclasses. More...
|
|
virtual S | createSolution (ParallelPRNG &engine) const =0 |
|
virtual int | getOptimizationDirection (const int i) const =0 |
| Returns the optimization direction for each objective in the problem. It returns Minimize or Maximize accordingly. This method must be implemented in the subclasses. More...
|
|
virtual float | getUpperLimit (const int i) const =0 |
| Returns the upper bound to the problem at dimension i. This method must be implemented in the subclasses. More...
|
|
virtual float | getLowerLimit (const int i) const =0 |
| Returns the lower bound to the problem at dimension i. This method must be implemented in the subclasses. More...
|
|
virtual string | getName () const =0 |
| Returns the name of the problem. This method must be implemented in the subclasses. More...
|
|
virtual void | readData (const std::string &path)=0 |
| Method to read problem information from the given path. This method must be implemented in the subclasses. More...
|
|
virtual json | to_json () const |
| Creates a JSON object with the information of the Problem. More...
|
|
int | getNumberOfVars () const |
| Get the number of variables (dimension) of the problem. More...
|
|
void | setNumberOfVars (int nVars) |
| Sets the number of variables (dimension) of the problem. More...
|
|
int | getNumberOfObjs () const |
| Get the number of objectives of the problem. More...
|
|
void | setNumberOfObjs (int nObjs) |
| Sets the number of objectives to the problem. More...
|
|
int | getNumberOfCons () const |
| Get the number the constraint of the problem. More...
|
|
void | setNumberOfCons (int nCons) |
| Sets the number of constraint of the problem. More...
|
|
template<class S>
class Problem< S >
Class to represent a Problem in the tool. It includes the basic information for a problem a few methods that must be implemented in the subclasses.
- Template Parameters
-
S | Type of individual in the population |
template<class S >
virtual S Problem< S >::createSolution |
( |
| ) |
const |
|
pure virtual |
template<class S >
virtual int Problem< S >::getOptimizationDirection |
( |
const int |
i | ) |
const |
|
pure virtual |
Returns the optimization direction for each objective in the problem. It returns Minimize or Maximize accordingly. This method must be implemented in the subclasses.
- Parameters
-
- Returns
- Minimize or Maximize constants.
Implemented in ZDT, Sphere, Rastrigin, DoubleSphere, TSP, KP, BPP, TSPDomain, KPDomain, BPPDomain, AbstractDomain< OptProblem, InstSolution >, AbstractDomain< TSP, TSPInstance >, AbstractDomain< BPP, BPPInstance >, and AbstractDomain< KPNR, KPInstance >.