Expand description
The unified optimization problem.
Problem is the single interface every forge optimizer consumes: a
box-constrained, real-valued search space plus a scalar objective. By
convention forge minimizes; a candidate whose objective is non-finite
(NaN/±∞) is treated as infeasible and rejected, so models that blow up
on degenerate parameters (a common case in hydrological calibration) need no
special handling.
Two adapters cover the everyday cases without writing a struct:
funcwraps a closure with explicit bounds.Maximizeflips the sense for objectives that should be maximized (e.g. NSE/KGE in rainflow), so the minimizing core stays the single convention.
Combinatorial problems (Anvil’s bit-flip simulated annealing) are served by a separate abstraction migrated in a later milestone; v0.1 is the continuous, population/real-vector substrate that unblocks rainflow.
Structs§
- Func
- Closure-backed problem produced by
func. - Maximize
- Wraps a problem so the engine maximizes its objective instead of minimizing it, by negating finite values (non-finite stay rejected).
- Multi
Func - Closure-backed multi-objective problem produced by
multi_func.
Enums§
- Bounds
Error - Why a problem’s bounds are invalid.
Traits§
- Multi
Problem - A box-constrained, real-valued multi-objective minimization problem.
- Problem
- A box-constrained, real-valued minimization problem.
Functions§
- func
- A
Problemdefined inline by a closure and a bounds vector. - multi_
func - A
MultiProblemdefined inline by a closure, a bounds vector, and an objective count. - validate
- Validates that a problem is well-formed: at least one variable and every
bound strictly ordered (
lower < upper), rejectingNaNbounds. - validate_
multi - Validates that a multi-objective problem is well-formed: valid bounds (as
in
validate) plus at least two objectives, and anobjectives()vector whose length matchesn_objectives()at the box midpoint.
Type Aliases§
- Bound
- Inclusive search bounds for one decision variable:
lower <= x <= upper.