stat_plot_hop_distribution

PURPOSE ^

SYNOPSIS ^

function hop_dist=stat_plot_hop_distribution(model,nb_mob,export,format)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function hop_dist=stat_plot_hop_distribution(model,nb_mob,export,format)
0002 
0003 res.models = { 'street' 'city' 'hexagonal' };
0004 res.model = char(res.models(model));
0005 
0006 res.mob    = nb_mob;
0007 
0008 res.tmax = 60;
0009 
0010 %max_nb_hop = test4(model,nb_mob);
0011 
0012 for cov = 1:20
0013     res.coverages = 5:5:100;
0014     res.coverage = res.coverages(cov);
0015 
0016     cdfstd2load = sprintf('%s/%dusr/%02dcov/hop-dist.dat',res.model,res.mob,res.coverage);
0017     load(cdfstd2load);
0018 
0019     temp_hop_dist(cov,:) = hop_dist';
0020 
0021     clear hop_dist
0022 end
0023 
0024 hop_dist = temp_hop_dist;
0025 clear temp_hop_dist;
0026 
0027 save('hop-dist.dat','hop_dist','-ascii','-tabs');
0028 unix(['mv *.dat ',sprintf('%s/%dusr/',res.model,res.mob)]);
0029 
0030 
0031 figure(6)
0032 bar([5:5:100],hop_dist,'stack')
0033 colormap(prism(40))
0034 axis([0 105 0 1])
0035 xlabel('coverage in %')
0036 ylabel('percentage of messages delivered')
0037 legend('directly','1 hop','2 hops','3 hops','4 hops','5 hops','6 hops','7 hops',5)
0038 title(sprintf('percentage of messages delivered with a given number of hops (%s model, %d users, %d min)',res.model,res.mob,res.tmax))
0039 if export == 1
0040     exportfig(gcf,[res.model '-' num2str(res.mob) 'usr-hop-distribution'],'color', 'cmyk','format',format);
0041 end
0042

Generated on Sun 15-Aug-2004 22:13:10 by m2html © 2003