fn generate_distributions(config: &Config, rng: &mut ThreadRng)
                            -> HashMap<(usize, usize, usize), (NormalParams, NormalParams)> {
    // Generate the distributions for each (node, query, metric) tuple
    debug!("generating distributions per (node,query,metric) tuple...");
    let mut distributions = HashMap::with_capacity(config.nodes * config.queries * config.metrics);
    for node in 0..config.nodes {
        for query in 0..config.queries {
            for metric in 0..config.metrics {

                // Each tuple gets a "regular" and "disrupted"
                // distribution from the allowed bounds
                let regular = NormalParams {
                    mean: rng.gen_range(config.regular_distribution.min_mean, config.regular_distribution.max_mean),
                    std: rng.gen_range(config.regular_distribution.min_std, config.regular_distribution.max_std)
                };

                let disrupted = NormalParams {
                    mean: rng.gen_range(config.disrupted_distribution.min_mean, config.disrupted_distribution.max_mean),
                    std: rng.gen_range(config.disrupted_distribution.min_std, config.disrupted_distribution.max_std)
                };

                distributions.insert((node, query, metric), (regular, disrupted));
            }
        }
    }

    distributions
}
// Generate the distributions for each (node, query, metric) tuple
Generate the distributions for each (node, query, metric) tuple
Generate the distributions for each ( node query metric ) tuple
fn generate_distributions(config: &Config, rng: &mut ThreadRng)
                            -> HashMap<(usize, usize, usize), (NormalParams, NormalParams)> {
    // Generate the distributions for each (node, query, metric) tuple
    debug!("generating distributions per (node,query,metric) tuple...");
    let mut distributions = HashMap::with_capacity(config.nodes * config.queries * config.metrics);
    for node in 0..config.nodes {
        for query in 0..config.queries {
            for metric in 0..config.metrics {
                // Each tuple gets a "regular" and "disrupted"
                // distribution from the allowed bounds
                let regular = NormalParams {
                    mean: rng.gen_range(config.regular_distribution.min_mean, config.regular_distribution.max_mean),
                    std: rng.gen_range(config.regular_distribution.min_std, config.regular_distribution.max_std)
                };
                let disrupted = NormalParams {
                    mean: rng.gen_range(config.disrupted_distribution.min_mean, config.disrupted_distribution.max_mean),
                    std: rng.gen_range(config.disrupted_distribution.min_std, config.disrupted_distribution.max_std)
                };
                distributions.insert((node, query, metric), (regular, disrupted));
            }
        }
    }
    distributions
}
fn generate_distributions ( config : & Config , rng : & mut ThreadRng ) -> HashMap < ( usize , usize , usize ) , ( NormalParams , NormalParams ) > { // Generate the distributions for each (node, query, metric) tuple debug ! ( " " ) ; let mut distributions = HashMap :: with_capacity ( config . nodes * config . queries * config . metrics ) ; for node in 0 .. config . nodes { for query in 0 .. config . queries { for metric in 0 .. config . metrics { // Each tuple gets a "regular" and "disrupted" // distribution from the allowed bounds let regular = NormalParams { mean : rng . gen_range ( config . regular_distribution . min_mean , config . regular_distribution . max_mean ) , std : rng . gen_range ( config . regular_distribution . min_std , config . regular_distribution . max_std ) } ; let disrupted = NormalParams { mean : rng . gen_range ( config . disrupted_distribution . min_mean , config . disrupted_distribution . max_mean ) , std : rng . gen_range ( config . disrupted_distribution . min_std , config . disrupted_distribution . max_std ) } ; distributions . insert ( ( node , query , metric ) , ( regular , disrupted ) ) ; } } } distributions }
Generate the distributions for each (node, query, metric) tuple
Generate the distributions for each ( node query metric ) tuple
config
&Config
rng
&mut ThreadRng
config
&Config
rng
&mut ThreadRng