function []=Simulation_Sexual_Selection(N,r,s,MaxLoops) % % Mixed_Games(Population_size, decay, sample_size, MaxLoops) % where N is the population size. % decay is the loss for having a long tail % [survial = exp(-decay*tail_length) ] % s is the number of males each female samples before selecting the best % MaxLoops is the number of loops % if nargin<4 MaxLoops=10000; if nargin<3 s=5; if nargin<2 r=0.1; if nargin<1 N=1000; end end end end r=abs(r); % just in case they give negative value %randomly asign males & females Sex=round(rand(N,1)); %randomly asign tail length Tail=abs(randn(N,1)); for L=1:MaxLoops Female=find(Sex==0); Male=find(Sex==1); %Males die due to tail length Surv_Males=Male(find(rand(length(Male),1)