Adds proptest as a dev-dependency and a `tests/properties.rs` integration suite that probes invariants on randomly generated inputs: Pareto invariants: - `pareto_compare` is anti-symmetric: A→B is opposite of B→A for Dominates / DominatedBy - `pareto_compare` is reflexive on equal candidates (returns Equal) - `pareto_front` output is internally non-dominated - `non_dominated_sort` puts every member into exactly one front - `crowding_distance` returns Vec same length as front; boundary points are infinity for fronts of size ≥ 2 in any axis-sortable configuration Operator invariants: - `SimulatedBinaryCrossover` returns 2 children of the right length, all in bounds - `PolynomialMutation` returns 1 child of the right length, in bounds - `BoundedGaussianMutation` returns 1 child in bounds - `ClampToBounds` repair always lands in bounds - `ProjectToSimplex` repair always sums to total and is non-negative Algorithm invariants: - For any seed, `Optimizer::run` is deterministic across two calls - Final population has the documented size for population-based algorithms These are the invariants the existing 226 fixed-input unit tests collectively check; proptest gives us coverage on inputs they don't cover individually.
34 lines
877 B
TOML
34 lines
877 B
TOML
[package]
|
|
name = "heuropt"
|
|
version = "0.3.0"
|
|
edition = "2024"
|
|
rust-version = "1.85"
|
|
authors = ["Stephen Waits <steve@waits.net>"]
|
|
description = "A practical Rust toolkit for heuristic single-, multi-, and many-objective optimization."
|
|
license = "MIT"
|
|
readme = "README.md"
|
|
repository = "https://github.com/swaits/heuropt"
|
|
homepage = "https://github.com/swaits/heuropt"
|
|
documentation = "https://docs.rs/heuropt"
|
|
keywords = ["optimization", "evolutionary", "nsga", "pareto", "moead"]
|
|
categories = ["algorithms", "science", "mathematics", "simulation"]
|
|
|
|
[features]
|
|
default = []
|
|
serde = ["dep:serde"]
|
|
parallel = ["dep:rayon"]
|
|
|
|
[dependencies]
|
|
rand = "0.9"
|
|
rand_distr = "0.5"
|
|
rayon = { version = "1", optional = true }
|
|
serde = { version = "1", features = ["derive"], optional = true }
|
|
|
|
[dev-dependencies]
|
|
gungraun = "0.18"
|
|
proptest = "1"
|
|
|
|
[[bench]]
|
|
name = "hot_paths"
|
|
harness = false
|