1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use necsim_core_bond::NonNegativeF64;

use crate::{
    cogs::{Habitat, MathsCore},
    landscape::Location,
};

#[allow(clippy::inline_always, clippy::inline_fn_without_body)]
#[contract_trait]
pub trait TurnoverRate<M: MathsCore, H: Habitat<M>>:
    crate::cogs::Backup + core::fmt::Debug
{
    #[must_use]
    #[debug_requires(
        habitat.is_location_habitable(location),
        "location is habitable"
    )]
    #[debug_ensures(
        ret != 0.0_f64 || habitat.get_habitat_at_location(location) == 0_u32,
        "only returns zero if the location is inhabitable"
    )]
    fn get_turnover_rate_at_location(&self, location: &Location, habitat: &H) -> NonNegativeF64;
}