%script to run simulations for NEid model
clear all
tic
ML = 0;
delete(gcp('nocreate'))
parpool('local',4);
spmd
    rng(0,'combRecursive');
end

path = '../data/simulationdata/NEid';
if exist(path)==0
   mkdir(path) ;
end


c =[0.004 0.0082 0.01 0.013 0.016];
d=[0.001 0.013 0.0202 0.025 0.05];

if ML ==1 % run maximum likelihood value
c=c(3);
d=d(4);
end

e=1;
L1=0;
L2=0;
Lapse=0;

run=0;
for i= 1:length(c)
    answer2D= robModel(c(i),e, L1,L2,Lapse ,3); %independent of d so only need to do for all of c
    for j=1:length(d)
    answer3D= robModel3D(c(i),d(j),e,L1, L2,Lapse ,3);
    C=c(i);
    D=d(j);
    save([path,'/fitNEid_',num2str(run),'.mat'])
    disp(run)
    run=run+1;
    end
end

