ScalarDataProblem
- class desdeo_problem.problem.ScalarDataProblem(decision_vectors, objective_vectors)[source]
Bases:
ProblemBase
A problem class for case where the data is pre-computed.
To be depreciated
Defines a problem with pre-computed data representing a multiobjective optimization problem with scalar valued objective functions.
- Parameters:
decision_vectors (np.ndarray) – A 2D vector of decision_vectors. Each row represents a solution with the value for each decision_vectors defined on the columns.
objective_vectors (np.ndarray) – A 2D vector of objective function values. Each row represents one objective vector with the values for the invidual objective functions defined on the columns.
- decision_vectors
See args
- Type:
np.ndarray
- objective_vectors
See args
- Type:
np.ndarray
- __epsilon
A small floating point number to shift the bounds of the variables. See, get_variable_bounds, default value 1e-6
- Type:
float
- __constraints
A list of defined constraints.
- Type:
List[ScalarConstraint]
- nadir
The nadir point of the problem.
- Type:
np.ndarray
- ideal
The ideal point of the problem.
- Type:
np.ndarray
- __model_exists
is there a model for this problem
- Type:
bool
Note
It is assumed that the decision_vectors and objectives follow a direct one-to-one mapping, i.e., the objective values on the ith row in ‘objectives’ should represent the solution of the multiobjective problem when evaluated with the decision_vectors on the ith row in ‘decision_vectors’.
Attributes Summary
Constraints.
epsilon.
Methods Summary
evaluate
(decision_vectors)Evaluate the values of the objectives at the given decision.
Evaluate the constraint values.
Get the variable bounds.
Attributes Documentation
- constraints
Constraints.
- Returns:
list of the defined constraints
- Return type:
List[ScalarConstraint]
- Type:
Property
- epsilon
epsilon.
- Returns:
epsilon value (for shifting the bounds of variables)
- Return type:
float
- Type:
Property
Methods Documentation
- evaluate(decision_vectors)[source]
Evaluate the values of the objectives at the given decision.
Evaluate the values of the objectives corresponding to the decision decision_vectors.
- Parameters:
decision_vectors (np.ndarray) – A 2D array with the decision decision_vectors to be evaluated on each row.
- Returns:
- A 2D array with the objective values corresponding to
each decision vectors on the rows.
- Return type:
nd.ndarray
Note
At the moment, this function just maps the given decision decision_vectors to the closest decision variable present (using an L2 distance) in the problem and returns the corresponsing objective vector.
- evaluate_constraint_values()[source]
Evaluate the constraint values.
Evaluate the constraint values for each defined constraint. A positive value indicates that a constraint is adhered to, a negative value indicates a violated constraint.
- Returns:
- A 2D array with each row representing the
constraint values for different objective vectors. One column for each constraint. If no constraint function are defined, returns None.
- Return type:
Optional[np.ndarray]
- get_variable_bounds()[source]
Get the variable bounds.
- Returns:
- The variable bounds in a stack. The epsilon value
will be added to the upper bounds and substracted from the lower bounds to return closed bounds.
- Return type:
np.array[float]
Note
If self.epsilon is zero, the bounds will represent an open range.