function [v,res] = BR_KBGD_driver_big(num_trials)
%

v = zeros(num_trials,5);
rng(1,'twister');

for t = 1:num_trials
    t
    
    len_KB = 0;
    while len_KB<10
        [KB,cc_probs,ap] = BR_gen_test_KB_ind(10,50,10);
        len_KB = length(KB);
    end
    BR_KB2GD(KB,'BR_KB');
    try
        [f,x] = BR_KB(0.5*ones(10,1));
        fail = 0;
    catch
        display('Error');
        fail = 1;
    end
    if fail==0
        load TR
        
        sol = tr(end,1:end-1);
        err = tr(end,end);
        
        Sp = BR_KB_ap2Sp(KB,sol);
        Spa = zeros(len_KB,1);
        for e = 1:len_KB
            Spa(e) = KB(e).prob;
        end
        
        res(t).sol = sol';
        res(t).err = err;
        res(t).Sp = Sp;
        res(t).Spa = Spa;
        res(t).ap = ap';
        res(t).cc_probs = cc_probs;
        res(t).sol_probs = BR_ap2ccp(sol);
        res(t).S_err = norm(res(t).Spa-res(t).Sp);
        res(t).iter = length(tr(:,1));
        res(t).Sp_ap = BR_KB_ap2Sp(KB,ap);
        
        v(t,1) = err;
        v(t,2) = res(t).iter;
        v(t,3) = res(t).S_err;
        v(t,4) = len_KB;
        v(t,5) = norm(res(t).Sp_ap-res(t).Sp);
        
        tch = 0;
    end
end

tch = 0;
