Macro krabmaga::gen_param

source ·
macro_rules! gen_param {
    ( $type:ty, $min:expr, $max:expr, $n:expr) => { ... };
    (  $type:ty, $min:expr, $max:expr) => { ... };
}
Expand description

Generate parameter values using a Uniform Distribution. Use it to generate a list of values for parameter sweeping.

Arguments

  • type - The type of the values to sample.
  • min - The minimum value of the range.
  • max - The maximum value of the range.
  • n - The number of values to sample.

Example

use krABMaga::*;

// Generate a list of 5 unsigned integers between 0 and 10
let values_u32 = gen_param!(u32, 0, 10, 5);

// Generate a list of 5 floats between 0.0 and 10.0
let values_f64 = gen_param!(f64, 0.0, 10.0, 5);