pub trait Algorithm<'p, M: MathsCore, G: RngCore<M>, O: Scenario<M, G>, R: Reporter, P: LocalPartition<'p, R>>: Sized + AlgorithmParamters + AlgorithmDefaults + AlgorithmDispatch<M, G, O, R> {
type LineageStore: LineageStore<M, O::Habitat>;
// Required methods
fn get_logical_partition(
args: &Self::Arguments,
local_partition: &P
) -> Partition;
fn initialise_and_simulate<I: Iterator<Item = u64>>(
args: Self::Arguments,
rng: G,
scenario: ScenarioCogs<M, G, O>,
pre_sampler: OriginPreSampler<M, I>,
pause_before: Option<NonNegativeF64>,
local_partition: &mut P
) -> Result<SimulationOutcome<M, G>, Self::Error>;
fn resume_and_simulate<I: Iterator<Item = u64>, L: ExactSizeIterator<Item = Lineage>>(
args: Self::Arguments,
rng: G,
scenario: ScenarioCogs<M, G, O>,
pre_sampler: OriginPreSampler<M, I>,
lineages: L,
resume_after: Option<NonNegativeF64>,
pause_before: Option<NonNegativeF64>,
local_partition: &mut P
) -> Result<SimulationOutcome<M, G>, ResumeError<Self::Error>>;
fn fixup_for_restart<I: Iterator<Item = u64>, L: ExactSizeIterator<Item = Lineage>>(
args: Self::Arguments,
rng: G,
scenario: ScenarioCogs<M, G, O>,
pre_sampler: OriginPreSampler<M, I>,
lineages: L,
restart_at: PositiveF64,
fixup_strategy: RestartFixUpStrategy,
local_partition: &mut P
) -> Result<SimulationOutcome<M, G>, ResumeError<Self::Error>>;
}
Required Associated Types§
type LineageStore: LineageStore<M, O::Habitat>
Required Methods§
fn get_logical_partition( args: &Self::Arguments, local_partition: &P ) -> Partition
sourcefn initialise_and_simulate<I: Iterator<Item = u64>>(
args: Self::Arguments,
rng: G,
scenario: ScenarioCogs<M, G, O>,
pre_sampler: OriginPreSampler<M, I>,
pause_before: Option<NonNegativeF64>,
local_partition: &mut P
) -> Result<SimulationOutcome<M, G>, Self::Error>
fn initialise_and_simulate<I: Iterator<Item = u64>>( args: Self::Arguments, rng: G, scenario: ScenarioCogs<M, G, O>, pre_sampler: OriginPreSampler<M, I>, pause_before: Option<NonNegativeF64>, local_partition: &mut P ) -> Result<SimulationOutcome<M, G>, Self::Error>
§Errors
Returns a Self::Error
if initialising the fresh simulation or running
the algorithm failed
sourcefn resume_and_simulate<I: Iterator<Item = u64>, L: ExactSizeIterator<Item = Lineage>>(
args: Self::Arguments,
rng: G,
scenario: ScenarioCogs<M, G, O>,
pre_sampler: OriginPreSampler<M, I>,
lineages: L,
resume_after: Option<NonNegativeF64>,
pause_before: Option<NonNegativeF64>,
local_partition: &mut P
) -> Result<SimulationOutcome<M, G>, ResumeError<Self::Error>>
fn resume_and_simulate<I: Iterator<Item = u64>, L: ExactSizeIterator<Item = Lineage>>( args: Self::Arguments, rng: G, scenario: ScenarioCogs<M, G, O>, pre_sampler: OriginPreSampler<M, I>, lineages: L, resume_after: Option<NonNegativeF64>, pause_before: Option<NonNegativeF64>, local_partition: &mut P ) -> Result<SimulationOutcome<M, G>, ResumeError<Self::Error>>
§Errors
Returns a ContinueError<Self::Error>
if initialising the resuming
simulation or running the algorithm failed
sourcefn fixup_for_restart<I: Iterator<Item = u64>, L: ExactSizeIterator<Item = Lineage>>(
args: Self::Arguments,
rng: G,
scenario: ScenarioCogs<M, G, O>,
pre_sampler: OriginPreSampler<M, I>,
lineages: L,
restart_at: PositiveF64,
fixup_strategy: RestartFixUpStrategy,
local_partition: &mut P
) -> Result<SimulationOutcome<M, G>, ResumeError<Self::Error>>
fn fixup_for_restart<I: Iterator<Item = u64>, L: ExactSizeIterator<Item = Lineage>>( args: Self::Arguments, rng: G, scenario: ScenarioCogs<M, G, O>, pre_sampler: OriginPreSampler<M, I>, lineages: L, restart_at: PositiveF64, fixup_strategy: RestartFixUpStrategy, local_partition: &mut P ) -> Result<SimulationOutcome<M, G>, ResumeError<Self::Error>>
§Errors
Returns a ContinueError<Self::Error>
if fixing up the restarting
simulation (incl. running the algorithm) failed
Object Safety§
This trait is not object safe.