/// Samples a random value from the `Meter`.
Samples a random value from the `Meter`.
Samples a random value from the ` Meter ` .
pub fn sample(&self) -> f64 {
        if self.consumption_bound == 0.0 {
            // If the upper bound was specified to be zero, there is no need to sample.
            0.0
        } else {
            // Samples from a unfiform distrubution. This fullfills the requirement of creating
            // continuous randomly distributed values as stated in the exercise's specifications.
            thread_rng().gen_range(0.0, self.consumption_bound)
        }
    }
pub fn sample ( & self ) -> f64 { if self . consumption_bound == 0.0 { // If the upper bound was specified to be zero, there is no need to sample. 0.0 } else { // Samples from a unfiform distrubution. This fullfills the requirement of creating // continuous randomly distributed values as stated in the exercise's specifications. thread_rng ( ) . gen_range ( 0.0 , self . consumption_bound ) } }
Samples a random value from the `Meter`.
Samples a random value from the ` Meter ` .
&self