use decider::build_ctx;
use decider::init_decider;

fn main() {
    // Eventually make this eat a local experiment config file, and then take in
    // simulated experiment/context calls.
    let d = init_decider(
        "darkmode fractional_availability".to_string(),
        "./cfg.json".to_string(),
    );

    let ctx = build_ctx();

    match d {
        Ok(dec) => {
            println!("dec: {:#?} \n ok", dec);
            let x = dec.choose("video_new_volume_policy_android".to_string(), &ctx);
            match x {
                Err(e) => println!("err: {:#?} \nerr ", e),
                Ok(opt) => match opt {
                    None => println!("option was None"),
                    Some(d) => {
                        println!("d: {:#?} \n ok", d);
                    }
                },
            }
        }
        Err(e) => println!("err: {:#?} \nerr ", e),
    }
}
