Skip to main content

mosa-analyze

Analyze Python MOSA solution archives by pruning Pareto fronts, merging runs, filtering thresholds, ranking with TOPSIS, and plotting objectives. Use with MOSA archive JSON or results from mosa.Anneal.

Source facts

Repository
rgaveiga/mosa
Last source activity
September 5, 2026 at 14:14
Detected SKILL.md language
English
Stars
7
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
2 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
mosa-analyze
description
Analyze Python MOSA solution archives by pruning Pareto fronts, merging runs, filtering thresholds, ranking with TOPSIS, and plotting objectives. Use with MOSA archive JSON or results from mosa.Anneal.
license
GPL-3.0
# MOSA archive analysis Use `from mosa import Anneal`. An archive is `{"x": [solution_dict, ...], "f": [[objective, ...], ...]}` with aligned rows. Objectives are minimized; maximized quantities are usually stored negated. Load JSON with `opt.loadx(archive_file="run.json")`, then check `opt.sizex()` before analysis. Missing/invalid files can print a message without raising. Use a new `Anneal` when loading an independent file to avoid confusing old state with loaded results. - `copyx()` makes a deep copy. Do not modify `opt.archive` directly. - `prune_dominated(xset)` returns a nondominated subset. - `mergex([a, b])` returns a pruned merge; inputs must have the same objective definitions, order, units and compatible solution groups. - `trimx(xset, thresholds=[None, limit])` keeps values <= thresholds; `None` skips an objective. Supply one entry per objective. No survivors raises `RuntimeError`. - `reducex(xset, index=0, nel=5)` selects the smallest values of one objective. - `bestx(xset, weights=[1.0, 0.25])` returns a one-solution archive using TOPSIS. Use finite nonnegative preferences, one per objective, with positive sum; defaults are equal. Transforms return archives. Pass the returned `xset` explicitly to subsequent analysis and `savex(xset=..., archive_file=...)`; omitting it uses the main archive. Read [analysis example](references/analysis.md) for filtering, saving, statistics and plots adapted from the alloy and thief notebooks. Report ranking preferences and restore negated quantities when explaining results. A TOPSIS choice expresses preferences, not a unique universal optimum.
View on GitHub