Pymoo constrained opt

From XuShuwenn/RedAct · View interactive version

Pymoo constrained opt is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Solve constrained optimization problems using pymoo with NSGA-II to minimize objective functions subject to constraints.

How to use this skill

Skill file

Constrained Optimization with pymoo

When to Use

Problem Example

Using pymoo

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

# Define problem with constraints
# Run NSGA-II optimizer

Output Format

To /root/output.txt:

Optimal x1: X.XX
Optimal x2: X.XX
Objective: X.XX

Round to 2 decimal places.

pymoo Components

Tips

x = res.X
f = res.F

if hasattr(x, "ndim") and x.ndim > 1:
    x = x[0]
if hasattr(f, "ndim") and f.ndim > 0:
    f = f[0]

x1, x2 = float(x[0]), float(x[1])
obj = float(f)
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.