clear; format compact; clf
wt=.5; c=1.5; retint=2;

for nitems = 1:4;

    for release=1:3;

        if release==1; increment=0; end;
        if release==2; increment=.5; end;
        if release==3; increment=1.5; end;

        clear dtim;
        clear dpos;

        wp=1-wt;

        nlists=1;

        for j=1:nitems*nlists; dtim(j)=(nitems*nlists-j); end
        dtim=dtim*10;
        dtim=dtim+retint;

        if nitems==1; dpos=[1]; end
        if nitems==2; dpos=[1 1]; end
        if nitems==3; dpos=[1 1 1]; end
        if nitems==4; dpos=[1 1 1 1]; dpos(4)=dpos(4)+increment; end

        for n=1:nitems*nlists; dtim(n)=log(dtim(n)); end

        for n=1:nitems*nlists; dd(n)=0.0; end

        for n=1:nitems*nlists;
            for m=1:nitems*nlists;
                distance=wt*abs(dtim(n)-dtim(m))+wp*abs(dpos(n)-dpos(m));
                dd(n) = dd(n) + exp(-c*(distance));
            end
            serpos(n)=1/dd(n);
        end

        results(release,nitems)=serpos(nitems*nlists)^3;

    end

end

plot(results')
hold on






