Struct netem_trace::model::bw::BoundedNormalizedBw
source · pub struct BoundedNormalizedBw {
pub mean: Bandwidth,
pub std_dev: Bandwidth,
pub upper_bound: Bandwidth,
pub lower_bound: Bandwidth,
pub duration: Duration,
pub step: Duration,
pub seed: u64,
/* private fields */
}Expand description
The model of a bandwidth trace subjects to a bounded normal distribution.
The bandwidth will subject to N(mean, std_dev), but bounded within [lower_bound, upper_bound]
Examples
let mut normal_bw = BoundedNormalizedBwConfig::new()
.mean(Bandwidth::from_mbps(12))
.std_dev(Bandwidth::from_mbps(1))
.duration(Duration::from_secs(1))
.step(Duration::from_millis(100))
.seed(42)
.upper_bound(Bandwidth::from_kbps(12100))
.lower_bound(Bandwidth::from_kbps(11900))
.build();
assert_eq!(normal_bw.next_bw(), Some((Bandwidth::from_bps(12069427), Duration::from_millis(100))));
assert_eq!(normal_bw.next_bw(), Some((Bandwidth::from_bps(12100000), Duration::from_millis(100))));Fields§
§mean: Bandwidth§std_dev: Bandwidth§upper_bound: Bandwidth§lower_bound: Bandwidth§duration: Duration§step: Duration§seed: u64Implementations§
Trait Implementations§
source§impl BwTrace for BoundedNormalizedBw
impl BwTrace for BoundedNormalizedBw
source§impl Clone for BoundedNormalizedBw
impl Clone for BoundedNormalizedBw
source§fn clone(&self) -> BoundedNormalizedBw
fn clone(&self) -> BoundedNormalizedBw
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more