1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#[cfg(test)]
#[path = "../../../tests/unit/solver/termination/max_generation_test.rs"]
mod max_generation_test;
use crate::solver::termination::Termination;
use crate::solver::RefinementContext;
pub struct MaxGeneration {
limit: usize,
}
impl MaxGeneration {
pub fn new(limit: usize) -> Self {
Self { limit }
}
}
impl Termination for MaxGeneration {
fn is_termination(&self, refinement_ctx: &mut RefinementContext) -> bool {
refinement_ctx.statistics.generation >= self.limit
}
}