Commit Graph
5 Commits
Author SHA1 Message Date
swaits 60e52a031c feat(traits): add Initializer, Variation, and Optimizer traits
The three operator-level traits the algorithms consume, plus the single
trait users implement to add a new optimizer (`Optimizer<P>`). All take
`&mut Rng` directly rather than being generic over the RNG (spec §7.8).
2026-05-04 19:18:01 -06:00
swaits d226601a44 feat(core): add Problem trait
The single trait users implement to describe an optimization problem:
associated `Decision: Clone` plus `objectives()` and `evaluate()`.
Both signatures match spec §8.1; `evaluate` takes `&self`.
2026-05-04 19:18:01 -06:00
swaits f6f41eda35 feat(core): add data types and Rng alias
Plain-data structs and the seeded Rng alias from spec §7. Each lives in
its own file under src/core/ with unit tests:

- Direction, Objective, ObjectiveSpace (with as_minimization negating
  only Maximize axes)
- Evaluation (is_feasible == constraint_violation <= 0.0)
- Candidate<D>, Population<D> (concrete, public fields, From<Vec<...>>)
- OptimizationResult<D>
- type Rng = rand::rngs::StdRng + rng_from_seed, so no public trait is
  generic over the RNG (spec §2.5)

All public types behind #[cfg_attr(feature = "serde", derive(...))] so
the optional feature wires up without changing the default surface.
2026-05-04 19:18:01 -06:00
swaits b827310822 chore: switch license to MIT and add rand/serde dependencies
- License the crate as MIT only.
- Fill in package description and `readme` field.
- Add rand 0.9 and rand_distr 0.5 (the `StdRng` and Normal sampler the
  spec mandates as the single Rng type).
- Add optional serde 1 gated behind a `serde` feature flag for later
  derives on core data types.
2026-05-04 19:18:01 -06:00
swaits 45f9080225 chore: scaffold empty cargo lib crate and add design spec
Initial state from `cargo new --lib` plus the technical design spec at
docs/heuropt_tech_design_spec.md, which is the source of truth for the
crate's public API and v1 acceptance criteria.
2026-05-04 19:18:00 -06:00