clear; format compact; clf
c=3.2536; wp=0.8799; wt=1-wp; nitems = 12; nlists=1;

for cond=1:2;
    if cond==1; increm=10; end; if cond==2; increm=0; end

    for j=1:nitems*nlists; dtim(j)=(nitems*nlists-j); end
    dtim=dtim*2; dtim=dtim+0.1;

    dpos=[1 2 3 4 5 6 7+increm 8 9 10 11 12];

    for n=1:nitems*nlists; dtim(n)=log(dtim(n)); dpos(n)=log(dpos(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(cond,:)=serpos;

end

plot(results')
hold on

