Finish 2012-11-07 16:00:00 UTC

randomRelaxShift

by Sebastian Ullmann

Status: Passed
Results: 6513 (cyc: 4, node: 120)
CPU Time: 5.725
Score: 6514.04
Submitted at: 2012-11-01 15:59:47 UTC
Scored at: 2012-11-01 21:08:27 UTC

Current Rank: 1575th (Highest: 5th )

Comments
Please login or create a profile.
Code
function xy = explodeRandomRelax(a, xy, wts)
  meanxy0 = mean(xy,1);
  xy = 100*xy;
  a = bsxfun(@rdivide,a,sum(a,2));
  for iRun = 1:30
    for i = 1:size(a,1)
      newxy = round(a(i,:)*xy+100*exp(-iRun/5)*(randn(1,2)));
      if all((xy(:,1)~=newxy(1))|(xy(:,2)~=newxy(2)))
        xy(i,:) = newxy;
      end
    end
  end
  xy = bsxfun(@plus,xy,round(meanxy0-mean(xy,1)));
end