simulhope_callback

PURPOSE ^

the console version of simulhope

SYNOPSIS ^

function simulhope_callback()

DESCRIPTION ^

 the console version of simulhope

  INPUT
   i          iteration index
   imax       maximum number of iterations

  OUTPUT


 $Id: simulhope_callback.m,v 1.13 2004/07/16 19:27:14 dalai Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % the console version of simulhope
0002 %
0003 %  INPUT
0004 %   i          iteration index
0005 %   imax       maximum number of iterations
0006 %
0007 %  OUTPUT
0008 %
0009 %
0010 % $Id: simulhope_callback.m,v 1.13 2004/07/16 19:27:14 dalai Exp $
0011 
0012 function simulhope_callback()
0013 
0014 handles=get(gcbf,'UserData');
0015 
0016 % user interface
0017 ui = 1;
0018 
0019 % type of model
0020 models = get(handles.model,'String');
0021 model = get(handles.model,'Value');
0022 
0023 % coverage base-stations
0024 coverage =  get(handles.coverage_set,'Value');
0025 
0026 % number of base-stations
0027 % bs =  str2num(get(handles.nbs,'String'));
0028 
0029 % number of users
0030 nb_mob = str2num(get(handles.nusers,'String'));
0031 
0032 % number of pedestrians
0033 nb_pedestrian = str2num(get(handles.nb_pedestrian,'String'));
0034 
0035 % number of vehiculars
0036 nb_vehicular = str2num(get(handles.nb_vehicular,'String'));
0037 
0038 % max speed for pedestrian : input in km/h
0039 pspeed = str2num(get(handles.pspeed,'String'));
0040 
0041 % max speed for vehicular : input in km/h
0042 vspeed = str2num(get(handles.vspeed,'String'));
0043 
0044 % messages arrivals intensity : input in msg/min
0045 lambda = str2num(get(handles.lambda,'String'));
0046 
0047 % time of simulation : input in min
0048 tmax = str2num(get(handles.tmax,'String'));
0049 
0050 % plotting the path of the mobiles
0051 plot.path = get(handles.plot_path,'Value');
0052 
0053 % plot the delay stats
0054 plot.delay = get(handles.plot_delay,'Value');
0055 
0056 % plot the buffer stats
0057 plot.buffer = get(handles.plot_buffer,'Value');
0058 
0059 % plot the number of hops stats
0060 plot.hops = get(handles.plot_hops,'Value');
0061 
0062 % dimensionnal parameter
0063 if (get(handles.model,'Value') == 1)
0064     r = 2000 ;
0065 else 
0066     r = 1000 ;
0067 end
0068 
0069 
0070 handles.display = newplot;
0071 
0072 [par,bs,mob,msg_mcn,msg_std,stats] = simulhope_cmd(ui,model,coverage,nb_mob,nb_pedestrian,pspeed,nb_vehicular,vspeed,lambda,tmax);
0073 
0074 handles.display = plot_env(par,bs,mob,plot.path);
0075 
0076 %[pdf_delay_std,pdf_delay_mcn,cdf_delay_std,cdf_delay_mcn,msg_delivered,msg_delivered_percentage,max_nb_hop,hop_dist_percentage,buffer_self,buffer_mcn,buffer_std] = simulhope_stats(par,bs,mob,msg_mcn,msg_std);
0077 %  stats = simulhope_stats(par,bs,mob,msg_mcn,msg_std);
0078 
0079 % assign to the "par" structure
0080 assignin('base','par',par);
0081 % assign to the "bs" structure
0082 assignin('base','bs',bs);
0083 % assign to the "mob" structure
0084 assignin('base','mob',mob);
0085 % assign to the "msg_mcn" structure
0086 assignin('base','msg_mcn',msg_mcn);
0087 % assign to the "msg_std" structure
0088 assignin('base','msg_std',msg_std);
0089 % assign to the "stats" structure
0090  assignin('base','stats',stats);
0091 
0092 
0093 
0094 if (plot.delay == 1)
0095     %figure(1)
0096     plot(stats.pdf_delay_std)
0097     %fig = plot([0:par.tmax],stats.pdf_delay_std,'r')
0098     %size([0:par.tmax]')
0099     %size([stats.pdf_delay_std]')
0100     %,[0:par.tmax]',stats.pdf_delay_mcn','b');
0101 
0102     figure(2)
0103     plot([0:par.tmax],[stats.cdf_delay_std],[0:par.tmax],[stats.cdf_delay_mcn]);
0104 
0105     figure(3)
0106     bar(stats.msg_delivered,0.5,'stack')
0107     colormap([1 0 0;0 1 0;0 0 1])
0108 
0109     figure(4)
0110     bar(stats.msg_delivered_percentage,0.5,'stack')
0111     colormap([1 0 0;0 1 0;0 0 1])
0112 end
0113 
0114 if (plot.hops == 1)
0115     figure(5)
0116     bar([0:stats.max_nb_hop],[stats.hop_dist_percentage],'stack')
0117     colormap([1 0 0;0 1 0;0 0 1]);
0118 end
0119 
0120 if (plot.buffer == 1)
0121 %      figure(6)
0122 %      plot(buffer_self,[1:par.mob])
0123 %      figure(7)
0124 %      plot(buffer_mcn)
0125 %      figure(8)
0126 %      plot(buffer_std)
0127 % assignin('base','buffer_self',buffer_self)
0128 % plot(mean(buffer_self)./max(buffer_self))
0129 %figure(6)
0130 %plot([mob(:).buffer_self]')
0131 end
0132 
0133 %    stats = simulhope_stats(par,bs,mob,msg);
0134 %      % plot the result (and export)
0135 %      if (par.ui == 1)
0136 %          varargout(1) = { 0 };
0137 %          varargout(2) = { plot_env(par,bs,mob) };
0138 %          %exportfig(gcf,'test.eps','Color','cmyk');
0139 %          %print('-deps','test');
0140 %          %saveas(gcf, 'output', 'fig')
0141 %      end
0142 
0143

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