solverforge_core/score/
mod.rs1mod bendable;
2mod hard_soft;
3mod hard_soft_decimal;
4mod simple;
5mod simple_decimal;
6
7pub use bendable::{BendableDecimalScore, BendableScore};
8pub use hard_soft::{HardMediumSoftScore, HardSoftScore};
9pub use hard_soft_decimal::{HardMediumSoftDecimalScore, HardSoftDecimalScore};
10pub use simple::SimpleScore;
11pub use simple_decimal::SimpleDecimalScore;
12
13use serde::{Deserialize, Serialize};
14use std::fmt::Display;
15
16pub trait Score: Clone + PartialOrd + Display + Serialize + for<'de> Deserialize<'de> {
17 fn is_feasible(&self) -> bool;
18 fn is_solution_initialized(&self) -> bool;
19 fn zero() -> Self
20 where
21 Self: Sized;
22 fn negate(&self) -> Self;
23 fn add(&self, other: &Self) -> Self;
24 fn subtract(&self, other: &Self) -> Self;
25}