1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use necsim_core::{
    cogs::{Backup, Habitat, MathsCore},
    landscape::IndexedLocation,
};
use necsim_core_bond::PositiveF64;

use super::EmigrationChoice;

#[allow(clippy::module_name_repetitions)]
#[derive(Debug, Default)]
pub struct AlwaysEmigrationChoice([u8; 0]);

#[contract_trait]
impl Backup for AlwaysEmigrationChoice {
    unsafe fn backup_unchecked(&self) -> Self {
        Self([])
    }
}

#[contract_trait]
impl<M: MathsCore, H: Habitat<M>> EmigrationChoice<M, H> for AlwaysEmigrationChoice {
    fn should_lineage_emigrate(
        &self,
        _indexed_location: &IndexedLocation,
        _time: PositiveF64,
        _habitat: &H,
    ) -> bool {
        true
    }
}