moead_framework.problem.combinatorial.mubqp.Mubqp

class moead_framework.problem.combinatorial.mubqp.Mubqp(instance_file=None, rho=None, m=None, n=None, qs=None)[source]

Bases: moead_framework.problem.problem.Problem

Implementation of the Multiobjective Unconstrained Binary Quadratic Programming problem. The problem is compatible with files generated by the mocobench generator http://mocobench.sourceforge.net/index.php?n=Problem.MUBQP

Example:

>>> from moead_framework.problem.combinatorial import Mubqp
>>>
>>> instance_file = "moead_framework/test/data/instances/mubqp_0_2_25_0.8_0.dat"
>>> mubqp = Mubqp(instance_file=instance_file)
>>>
>>> # Generate a new solution
>>> solution = mubqp.generate_random_solution()
>>>
>>> # Print all decision variables of the solution
>>> print(solution.decision_vector)
>>>
>>> # Print all objectives values of the solution
>>> print(solution.F)
__init__(instance_file=None, rho=None, m=None, n=None, qs=None)[source]

Constructor of the problem

Parameters

objective_number – {integer}

Methods

__init__([instance_file, rho, m, n, qs])

Constructor of the problem

evaluate(x)

Evaluate the given solution for the current problem and store the outcome

f(function_id, decision_vector)

Evaluate the decision_vector for the objective function_id

generate_random_solution()

Generate a random solution for the current problem

init_with_data(rho, m, n, qs)

init_with_instance_file(instance_file)

load_qs(file_content)

Load values of the instance file

dtype

alias of builtins.float

evaluate(x: Union[moead_framework.solution.base.Solution, Sequence]) → moead_framework.solution.one_dimension_solution.OneDimensionSolution

Evaluate the given solution for the current problem and store the outcome

Parameters

x – A {Solution} containing all decision variables

Returns

OneDimensionSolution

f(function_id: int, decision_vector: numpy.ndarray)[source]

Evaluate the decision_vector for the objective function_id

Parameters
  • function_id – {integer} index of the objective

  • decision_vector – {OneDimensionSolution} solution to evaluate

Returns

{float} fitness value

generate_random_solution()[source]

Generate a random solution for the current problem

Returns

{OneDimensionSolution}

load_qs(file_content)[source]

Load values of the instance file

Parameters

file_content – {list<float>} content of the instance file

Returns