function yRSS = simData(xLocs, linkLocs, linkDist, sigma)
% PURPOSE : Generate simulation RSS data
% INPUTS  : - xLocs = estimated locations of each particles. 
%           - linkLocs = locations of node pair for each link.
%           - linkDist = Distance of a link.
%           - sigma = variable controls rate of decay in pixel-free model
% OUTPUTS : - yRSS = simulation RSS data
% AUTHORS  : Xi Chen and Yunpeng Li
%            @ECE Department, McGill University
%            http://www.tsp.ece.mcgill.ca/Networks/index.html
% DATE     : Jun 29, 2011

    % Calculate the distance between a particle and node pair [A B]
    distP2A = L2distance(linkLocs(1:2,:), xLocs);
    distP2B = L2distance(linkLocs(3:4,:), xLocs);
    
    % Calculate parameter \lambda in the ellipse
    lambdaVector = distP2A + distP2B - linkDist * ones(1,size(xLocs,2));
    
    % Generate RSS data through pixel-free model
    yRSS = exp(-lambdaVector / (2*sigma));
end