Skip to main content

Module problem

Module problem 

Source
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:

  • func wraps a closure with explicit bounds.
  • Maximize flips 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).
MultiFunc
Closure-backed multi-objective problem produced by multi_func.

Enums§

BoundsError
Why a problem’s bounds are invalid.

Traits§

MultiProblem
A box-constrained, real-valued multi-objective minimization problem.
Problem
A box-constrained, real-valued minimization problem.

Functions§

func
A Problem defined inline by a closure and a bounds vector.
multi_func
A MultiProblem defined 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), rejecting NaN bounds.
validate_multi
Validates that a multi-objective problem is well-formed: valid bounds (as in validate) plus at least two objectives, and an objectives() vector whose length matches n_objectives() at the box midpoint.

Type Aliases§

Bound
Inclusive search bounds for one decision variable: lower <= x <= upper.