T0 + T1 + T2: engine redesign through new API surface #1
18
src/error.rs
Normal file
18
src/error.rs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
use std::fmt;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
pub enum InferenceError {
|
||||||
|
NegativePrecision { pi: f64 },
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Display for InferenceError {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
match self {
|
||||||
|
Self::NegativePrecision { pi } => {
|
||||||
|
write!(f, "precision must be non-negative; got {pi}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::error::Error for InferenceError {}
|
||||||
@@ -11,6 +11,7 @@ pub mod agent;
|
|||||||
mod approx;
|
mod approx;
|
||||||
pub mod batch;
|
pub mod batch;
|
||||||
pub mod drift;
|
pub mod drift;
|
||||||
|
mod error;
|
||||||
mod game;
|
mod game;
|
||||||
pub mod gaussian;
|
pub mod gaussian;
|
||||||
mod history;
|
mod history;
|
||||||
@@ -19,6 +20,7 @@ mod message;
|
|||||||
pub mod player;
|
pub mod player;
|
||||||
|
|
||||||
pub use drift::{ConstantDrift, Drift};
|
pub use drift::{ConstantDrift, Drift};
|
||||||
|
pub use error::InferenceError;
|
||||||
pub use game::Game;
|
pub use game::Game;
|
||||||
pub use gaussian::Gaussian;
|
pub use gaussian::Gaussian;
|
||||||
pub use history::History;
|
pub use history::History;
|
||||||
|
|||||||
Reference in New Issue
Block a user