use std::time::Duration;
use crate::genetic::chromosome::Chromosome;
pub struct GeneticSolution<C>
where
C: Chromosome,
{
chromosome: C,
generations: u64,
mutations: u64,
runtime: Duration,
}
impl<C> GeneticSolution<C>
where
C: Chromosome,
{
pub fn new(chromosome: C, generations: u64, mutations: u64, runtime: Duration) -> Self {
GeneticSolution {
chromosome,
generations,
mutations,
runtime,
}
}
#[inline]
pub fn chromosome(&self) -> &C {
&self.chromosome
}
#[inline]
pub fn generations(&self) -> u64 {
self.generations
}
#[inline]
pub fn mutations(&self) -> u64 {
self.mutations
}
#[inline]
pub fn runtime(&self) -> Duration {
self.runtime
}
}