Struct reservoirs::reservoir::Reservoir[][src]

pub struct Reservoir { /* fields omitted */ }

Struct for recording reservoir characteristics.

Implementations

impl Reservoir[src]

pub fn fit_rate(
    &self,
    period: &f64,
    other: &Vec<f64>,
    boot: usize
) -> (f64, f64, f64)
[src]

pub fn gof(&self, other: &Vec<f64>) -> (f64, f64)[src]

pub fn inherit(self, ages: &Vec<f64>) -> Self[src]

Inherited age refers to age of charcoal upon entering the reservoir. Multiple samples of charcoal from a single deposit produces a vector of inherited ages, represented by the mean expected age of each charcoal sample in a f64 vector. The sample age of charcoal is the sum of its inherited age plus transit time through the reservoir. When simulating a reservoir model, each event entering the reservoir receives a random amount of inherited age sampled from the vector ages.

Examples

let charcoal_ages = vec![10.0, 43.5, 10000.0, 97.6];
res = res.inherit(&charcoal_ages);

pub fn input(self, rate: &f64) -> Result<Self, ExpError>[src]

Assign an input rate to a reservoir. Converts a reference to a float 64 rate into an exponential distribution with lamdba rate using the rand crate.

Examples

res = res.input(&0.58);

pub fn new() -> Self[src]

Create reservoirs using a builder pattern. Calling new() creates an empty reservoir. Use the input and output methods to set rates, which start at None. Set inherited age similarly using the method inherit.

Examples

use reservoirs::prelude::*;
let mut res = Reservoir::new();

pub fn output(self, rate: &f64) -> Result<Self, ExpError>[src]

Assign an output rate to a reservoir. Converts a reference to a float 64 rate into an exponential distribution with lamdba rate using the rand crate.

Examples

res = res.output(&0.58);

pub fn sim(self, period: &f64) -> Result<Self, ExpError>[src]

pub fn stereotype(&self, period: &f64, boot: usize, bins: usize) -> Vec<f64>[src]

pub fn sim_range(
    &self,
    period: &f64,
    boot: usize,
    bat: usize,
    dur: u64,
    input: Range<f64>,
    output: Range<f64>,
    obs: &Vec<f64>,
    title: &str
)
[src]

pub fn sim_rng(
    &self,
    period: &f64,
    boot: usize,
    bat: usize,
    input: Range<f64>,
    output: Range<f64>,
    obs: &Vec<f64>
) -> Vec<Gof>
[src]

pub fn sim_steady(
    &self,
    period: &f64,
    boot: usize,
    bat: usize,
    dur: u64,
    rate: Range<f64>,
    obs: &Vec<f64>,
    title: &str
)
[src]

pub fn steady(
    &self,
    period: &f64,
    boot: usize,
    bat: usize,
    rate: Range<f64>,
    obs: &Vec<f64>
) -> Vec<Gof>
[src]

Trait Implementations

impl Clone for Reservoir[src]

impl Debug for Reservoir[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,