Skip to content

[BUG] ScipyDeSolver (and potentially other solvers) does not work with simulator problems. #549

Description

@light-weaver
  • Describe the bug
    ScipyDESolver uses PolarsEvaluator to conduct evaluations. This does not handle simulators or surrogates. Replacing with Simulator Evaluator fixed the issue for me.

  • To reproduce
    Steps (or a minimal code example) to reproduce the behavior:

# Get metallurgical problem from https://desdeo.readthedocs.io/en/latest/howtoguides/advancedSurrogates/
test = {"UTS":1, "YS":1, "ELON":1} # Just some random values, does not need to be valid
scalarized_problem, symbol = add_asf_nondiff(
        metall_problem, symbol="AAA", reference_point=test, ideal=test, nadir=test, reference_in_aug=True
    )
solver = ScipyDeSolver(scalarized_problem)
#solver.evaluator = SimulatorEvaluator(scalarized_problem)
results: SolverResults = solver.solve(symbol)

Uncommenting the solver.evaluator statement makes the thing work as I need it to. But I do not know if it breaks any other usecases.

  • Expected behavior
    Thing should work.

  • Actual behavior / error output
    Thing did not work. In PolarsEvaluator._polars_evaluate():

        for symbol, expr in self.objective_expressions:
            if expr is not None:
                # expression given
                ....
            else:
                # expr is None and there are no no simulator or surrogate based objectives,
                # therefore we must get the objective function's value somehow else, usually from data
                ...

The expr variable turns out to be None, which then defaults to using find_closest_points()

  • Environment
    • DESDEO version (e.g. output of pip show desdeo): 2.6.0
    • Python version: 3.13.7
    • Operating system: I use arch btw.
    • Installation method (PyPI / from source, uv / poetry / pip): uv (recently synced)
    • Relevant optional solvers installed (Gurobi, IPOPT, BONMIN, CBC, ...): All of them, but this isn't relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions