mod allocations_sensor;
mod and_sensor_and_pool;
mod map_sensor;
mod maximise_each_counter_pool;
mod maximise_observation_pool;
mod most_n_diverse_pool;
mod noop_sensor;
mod simplest_to_activate_counter_pool;
mod static_value_sensor;
mod test_failure_pool;
mod unique_values_pool;
mod unit_pool;
#[doc(inline)]
pub use allocations_sensor::{AllocationSensor, CountingAllocator};
#[doc(inline)]
pub use and_sensor_and_pool::{AndPool, AndSensor, AndSensorAndPool, DifferentObservations, SameObservations};
#[doc(inline)]
pub use map_sensor::MapSensor;
#[doc(inline)]
pub use map_sensor::WrapperSensor;
#[doc(inline)]
pub use maximise_each_counter_pool::MaximiseEachCounterPool;
#[doc(inline)]
pub use maximise_observation_pool::MaximiseObservationPool;
#[doc(inline)]
pub use most_n_diverse_pool::MostNDiversePool;
#[doc(inline)]
pub use noop_sensor::NoopSensor;
#[doc(inline)]
pub use simplest_to_activate_counter_pool::SimplestToActivateCounterPool;
#[doc(inline)]
pub use static_value_sensor::StaticValueSensor;
#[doc(inline)]
pub use test_failure_pool::TestFailure;
#[doc(inline)]
pub use test_failure_pool::TestFailurePool;
#[doc(inline)]
pub use test_failure_pool::TestFailureSensor;
pub(crate) use test_failure_pool::TEST_FAILURE;
#[doc(inline)]
pub use unique_values_pool::UniqueValuesPool;
#[doc(inline)]
pub use unit_pool::UnitPool;
#[doc(inline)]
pub use crate::code_coverage_sensor::CodeCoverageSensor;
use crate::{Pool, Sensor};
pub trait PoolExt: Pool + Sized {
fn and<P, SM>(self, p: P, override_weight: Option<f64>, _sensor_marker: SM) -> AndPool<Self, P, SM>
where
P: Pool,
{
let self_weight = self.weight();
let p_weight = p.weight();
AndPool::<_, _, SM>::new(self, p, self_weight, override_weight.unwrap_or(p_weight))
}
}
impl<P> PoolExt for P where P: Pool {}
pub trait SensorExt: Sensor {
#[no_coverage]
fn map<ToObservations, F>(self, map_f: F) -> MapSensor<Self, ToObservations, F>
where
Self: Sized,
F: Fn(Self::Observations) -> ToObservations,
{
MapSensor::new(self, map_f)
}
}
impl<T> SensorExt for T where T: Sensor {}
pub mod stats {
use std::fmt::Display;
#[doc(inline)]
pub use super::and_sensor_and_pool::AndPoolStats;
#[doc(inline)]
pub use super::maximise_each_counter_pool::MaximiseEachCounterPoolStats;
#[doc(inline)]
pub use super::most_n_diverse_pool::MostNDiversePoolStats;
#[doc(inline)]
pub use super::simplest_to_activate_counter_pool::UniqueCoveragePoolStats;
#[doc(inline)]
pub use super::test_failure_pool::TestFailurePoolStats;
#[doc(inline)]
pub use super::unique_values_pool::UniqueValuesPoolStats;
use crate::traits::Stats;
use crate::{CSVField, ToCSV};
#[derive(Clone, Copy)]
pub struct EmptyStats;
impl Display for EmptyStats {
#[no_coverage]
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
impl ToCSV for EmptyStats {
#[no_coverage]
fn csv_headers(&self) -> Vec<CSVField> {
vec![]
}
#[no_coverage]
fn to_csv_record(&self) -> Vec<CSVField> {
vec![]
}
}
impl Stats for EmptyStats {}
}