[package]
name = "elevator-core"
version = "15.32.0" # managed by release-please
edition.workspace = true
description = "Engine-agnostic elevator simulation library with pluggable dispatch strategies"
license.workspace = true
repository.workspace = true
readme = "../../README.md"
rust-version.workspace = true
categories = ["game-engines", "simulation"]
keywords = ["elevator", "dispatch", "simulation", "ecs", "building"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["traffic"]
traffic = ["dep:rand"]
energy = []
# Replace `f64::mul_add` calls with the equivalent `(a * b) + c`
# expression. The hardware-FMA path is deterministic on
# wasm32-unknown-unknown (lowered to libm fma) but the spec doesn't
# guarantee bit-equality across all targets — relevant for consumers
# running lockstep across heterogeneous hosts (native + wasm32, etc.).
# Trades one rounding step for two; the precision difference is
# below the threshold any consumer cares about, while the
# host-independence guarantee tightens.
deterministic-fp = []

[lints]
workspace = true

[dependencies]
serde.workspace = true
ron.workspace = true
rand = { workspace = true, optional = true }
slotmap.workspace = true
ordered-float = { version = "5", features = ["serde"] }
smallvec = { version = "1", features = ["serde"] }
postcard.workspace = true
pathfinding = { version = "4", default-features = false }

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
proptest = "1"
rand = { workspace = true }
serde_json = "1"

[[test]]
name = "scenarios_adaptive_reposition"
path = "tests/scenarios/adaptive_reposition.rs"

[[test]]
name = "scenarios_basic"
path = "tests/scenarios/basic.rs"

[[test]]
name = "scenarios_penthouse_pickup"
path = "tests/scenarios/penthouse_pickup.rs"

[[test]]
name = "scenarios_deterministic_replay"
path = "tests/scenarios/deterministic_replay.rs"

[[test]]
name = "scenarios_dispatch_matrix"
path = "tests/scenarios/dispatch_matrix.rs"

[[test]]
name = "scenarios_edge_cases"
path = "tests/scenarios/edge_cases.rs"

[[test]]
name = "scenarios_multi_line"
path = "tests/scenarios/multi_line.rs"

[[test]]
name = "scenarios_negative"
path = "tests/scenarios/negative.rs"

[[test]]
name = "scenarios_service_modes"
path = "tests/scenarios/service_modes.rs"

[[test]]
name = "scenarios_single_call_single_car"
path = "tests/scenarios/single_call_single_car.rs"

[[test]]
name = "scenarios_snapshot_roundtrip"
path = "tests/scenarios/snapshot_roundtrip.rs"

[[bench]]
name = "sim_bench"
harness = false

[[bench]]
name = "scaling_bench"
harness = false

[[bench]]
name = "dispatch_bench"
harness = false

[[bench]]
name = "multi_line_bench"
harness = false

[[bench]]
name = "query_bench"
harness = false

[[example]]
name = "dispatch_comparison"
required-features = ["traffic"]
