Multi-objective scoring#

The openswmm_gymnasium.scoring module ships pure-numpy implementations of standard MOO metrics. No pymoo / platypus dependency on the critical path; an optional platypus_adapter plugs into the Platypus MOEA library.

Pareto-front extraction#

from openswmm_gymnasium.scoring import pareto_front
nd = pareto_front(points)  # (n, d) → non-dominated subset

Hypervolume#

Exact closed-form for d ≤ 2; Monte Carlo for d ≥ 3. The normalized_hypervolume() helper normalises against ideal / reference so the result is in [0, 1] regardless of objective scale.

from openswmm_gymnasium.scoring import hypervolume, normalized_hypervolume

hv = hypervolume(points, reference=[1.0, 1.0])
nhv = normalized_hypervolume(points, ideal=[0, 0], reference=[100, 50])

IGD / IGD+#

igd() is the classic Inverted Generational Distance; igd_plus() is the Pareto-compliant variant — zero whenever the approximation weakly dominates the reference set.

from openswmm_gymnasium.scoring import igd, igd_plus
igd_val  = igd(approximation, true_front)
idg_plus_val = igd_plus(approximation, true_front)

Other indicators#

Per-episode score in MO envs#

SwmmMORTCEnv populates info["mo_score"] at episode termination with the single-point normalised hypervolume of the episode’s cumulative-cost vector against the user-supplied ideal_point and reference_point. Useful as a training signal or for cross-policy comparison.