Pymoo optimization

From XuShuwenn/RedAct · View interactive version

Pymoo optimization is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Solve multi-objective optimization problems using pymoo with NSGA-II to find Pareto front solutions.

How to use this skill

Skill file

Multi-Objective Optimization with pymoo

When to Use

Problem Example

Using pymoo

from pymoo.optimize import minimize
from pymoo.algorithms.nsga2 import NSGA2


## Using pymoo

## Execution Workflow

- For fully specified tasks, prefer one self-contained script that defines the problem, runs `minimize`, extracts results, formats them, and writes `/root/output.txt` in the same run.
- If you need a helper script and the first location is not writable, use a confirmed writable scratch path such as `/tmp`.
- Create outputs only in confirmed writable locations, but ensure the final artifact is written to `/root/output.txt` when required.
- Build the final deliverable from the solver result rather than from exploratory prints or manual post-processing.
- If `minimize` fails early, check the pymoo problem interface and the shape of `out["F"]` first.
# Define problem with 2 objectives
# Run NSGA-II: population=50, generations=3

Output Format

To /root/output.txt:

{x1_value}={f1_value},{f2_value}

Sorted by x1 ascending, x1 to 3 decimal places.

Pareto Front

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.