fn new(params: FuzzParams) -> Self {
        let seed = params.rng_seed.unwrap_or(
            SystemTime::now()
                .duration_since(SystemTime::UNIX_EPOCH)
                .unwrap()
                .as_millis() as u64,
        );
        // Print the seed in case we need to replicate one run
        println!("Fuzz generator using seed: {}", seed);
        let mut rng = StdRng::seed_from_u64(seed);
        let state = Self::generate_initial_state(&mut rng, seed, &params);
        Self {
            params: params.clone(),
            state,
            rng,
            weighted_index: WeightedIndex::new(
                params
                    .ops_to_generate
                    .iter()
                    .map(|(_, weight)| *weight)
                    .collect::<Vec<f64>>()
                    .as_slice(),
            )
            .expect("Couldn't build weighted index"),
            next_op_id: 0,
        }
    }
/// Creates a new fuzz generator with some initial state.
Creates a new fuzz generator with some initial state.
Creates a new fuzz generator with some initial state .
fn new(params: FuzzParams) -> Self {
        let seed = params.rng_seed.unwrap_or(
            SystemTime::now()
                .duration_since(SystemTime::UNIX_EPOCH)
                .unwrap()
                .as_millis() as u64,
        );
        // Print the seed in case we need to replicate one run
        println!("Fuzz generator using seed: {}", seed);
        let mut rng = StdRng::seed_from_u64(seed);
        let state = Self::generate_initial_state(&mut rng, seed, &params);
        Self {
            params: params.clone(),
            state,
            rng,
            weighted_index: WeightedIndex::new(
                params
                    .ops_to_generate
                    .iter()
                    .map(|(_, weight)| *weight)
                    .collect::<Vec<f64>>()
                    .as_slice(),
            )
            .expect("Couldn't build weighted index"),
            next_op_id: 0,
        }
    }
fn new ( params : FuzzParams ) -> Self { let seed = params . rng_seed . unwrap_or ( SystemTime :: now ( ) . duration_since ( SystemTime :: UNIX_EPOCH ) . unwrap ( ) . as_millis ( ) as u64 , ) ; // Print the seed in case we need to replicate one run println ! ( " " seed ) ; let mut rng = StdRng :: seed_from_u64 ( seed ) ; let state = Self :: generate_initial_state ( & mut rng , seed , & params ) ; Self { params : params . clone ( ) , state , rng , weighted_index : WeightedIndex :: new ( params . ops_to_generate . iter ( ) . map ( | ( _ , weight ) | * weight ) . collect :: < Vec < f64 > > ( ) . as_slice ( ) , ) . expect ( " " ) , next_op_id : 0 , } }
Creates a new fuzz generator with some initial state.
Creates a new fuzz generator with some initial state .
params
FuzzParams
params
FuzzParams