/// Select based on generated calls.
Select based on generated calls.
Select based on generated calls .
pub fn select_with_calls(ctx: &Context, rng: &mut RngType) -> SyscallId {
    /// Selectors that can be used when initial calls are given.
    const SELECTORS: [Selector; 4] = [
        select_with_relation,      // 60%
        select_res_input_syscall,  // 20%
        select_res_output_syscall, // 15%
        select_random_syscall,     // 5%
    ];
    const WEIGHTS: [Weight; 4] = [60, 80, 95, 100];
    loop {
        let idx = choose_weighted(rng, &WEIGHTS);
        if let Some(sid) = SELECTORS[idx](ctx, rng) {
            debug_info!("select strategy-{}: {}", idx, ctx.target().syscall_of(sid));
            return sid;
        }
    }
}
pub fn select_with_calls ( ctx : & Context , rng : & mut RngType ) -> SyscallId { /// Selectors that can be used when initial calls are given. const SELECTORS : [ Selector ; 4 ] = [ select_with_relation , // 60% select_res_input_syscall , // 20% select_res_output_syscall , // 15% select_random_syscall , // 5% ] ; const WEIGHTS : [ Weight ; 4 ] = [ 60 , 80 , 95 , 100 ] ; loop { let idx = choose_weighted ( rng , & WEIGHTS ) ; if let Some ( sid ) = SELECTORS [ idx ] ( ctx , rng ) { debug_info ! ( " " idx ctx target ( ) syscall_of ( sid ) ) ; return sid ; } } }
Select based on generated calls.
Select based on generated calls .
ctx
&Context
rng
&mut RngType