Amel NAIT-AMER
Amel NAIT-AMER

Reputation: 1

How to define the input of a 2D layout problem

I am trying to implement this article: https://theses.hal.science/tel-00468463/ and more precisely to reproduce the example on a car trunk loading problem in which a series of components must be placed. The objective of the problem is to arrange all the components such that the inertia of the assembly is minimal and the distances between certain components are maximum. (example on page 103 of the article)

I want to define the problem but I don't know how I can insert the coordinate data of the equipment (the x and y coordinates of each equipment) as well as that of a container in the definition of the problem in pymoo. How to integrate the coordinates of the equipment into the class where I define the objective functions

import numpy as np
from pymoo.core.problem import Problem

class MyProblem(Problem):

    def __init__(self):
        super().__init__(n_var=2,
                         n_obj=2,
                         xl=-2.0,
                         xu=2.0)

    def _evaluate(self, x, out, *args, **kwargs):
        f1 = 100 * (x[:, 0]**2 + x[:, 1]**2)
        f2 = (x[:, 0]-1)**2 + x[:, 1]**2
        out["F"] = np.column_stack([f1, f2])

Another question is: is the pymoo package with the NSG1-II algorithm suitable for solving this type of problem?

Upvotes: 0

Views: 44

Answers (0)

Related Questions