function [S,f,w]=modify(pops,CostFunction)
    S = pops.Position;
    Q = pops.Asset;
    numAsset = 10;
    % if (numAsset*0.05 > 1) || (numAsset < 1)
    %     return;
    % end
    w = zeros([1 length(S)]);
    L = sum(S(Q));
    F = 1-numAsset*0.01;
    w(Q) = 0.01 + S(Q) * F / L;
    % [~,R] = find(w>1);
    % if ~isempty(R)
    %     L = sum(w(setdiff(Q,R)));
    %     F = 1 - (numAsset-length(R))*0.01 - length(R);
    %     w(R) = 1;
    %     w(setdiff(Q,R)) = 0.01 + w(setdiff(Q,R)) * F / L;
    % end
    S = zeros([1 length(S)]);
    S(Q) = w(Q) - 0.01;
    f = CostFunction(w);
end