Skip to content

Provide evaluation id to simulation #726

@fab6

Description

@fab6

Hi,

I am quite new to pymoo and try to adjust my old workflow to the tool. It seems very powerful :-)

At the moment, I define the problem like:

class MyProblem(ElementwiseProblem):

    def __init__(self):
        super().__init__(n_var=2,
                         n_obj=2,
                         n_ieq_constr=0)
                       +
    def _evaluate(self, x, out, *args, **kwargs):
        intI = random.randint(0, 900)
        x = np.insert(x,0, intI)
        parameterNameL = run_SIM.readYaml("run_SETTINGS.yaml")
        y = run_SIM.callSIM_script(x, parameterNameL )
        f1 = y[0]
        f2 = y[1]
        out["F"] = [f1, f2]
    problem = MyProblem()
    algorithm = NSGA2(pop_size=10, sampling=X)
    
    res = minimize(problem,
                   algorithm,
                   ("n_gen", 10),
                   verbose=True,
                   seed=1)

This seems to work fine, but at the moment I need to np.insert some random id which is used to create running directories for each simulation, e.g. like

Image

This works, but it would be great, if I could pass an id starting with 0 to it.

Is there an option to do this or do you have a hint, how I can do this?
Fab

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions