0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 function simulhope_callback()
0013
0014 handles=get(gcbf,'UserData');
0015
0016
0017 ui = 1;
0018
0019
0020 models = get(handles.model,'String');
0021 model = get(handles.model,'Value');
0022
0023
0024 coverage = get(handles.coverage_set,'Value');
0025
0026
0027
0028
0029
0030 nb_mob = str2num(get(handles.nusers,'String'));
0031
0032
0033 nb_pedestrian = str2num(get(handles.nb_pedestrian,'String'));
0034
0035
0036 nb_vehicular = str2num(get(handles.nb_vehicular,'String'));
0037
0038
0039 pspeed = str2num(get(handles.pspeed,'String'));
0040
0041
0042 vspeed = str2num(get(handles.vspeed,'String'));
0043
0044
0045 lambda = str2num(get(handles.lambda,'String'));
0046
0047
0048 tmax = str2num(get(handles.tmax,'String'));
0049
0050
0051 plot.path = get(handles.plot_path,'Value');
0052
0053
0054 plot.delay = get(handles.plot_delay,'Value');
0055
0056
0057 plot.buffer = get(handles.plot_buffer,'Value');
0058
0059
0060 plot.hops = get(handles.plot_hops,'Value');
0061
0062
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
0077
0078
0079
0080 assignin('base','par',par);
0081
0082 assignin('base','bs',bs);
0083
0084 assignin('base','mob',mob);
0085
0086 assignin('base','msg_mcn',msg_mcn);
0087
0088 assignin('base','msg_std',msg_std);
0089
0090 assignin('base','stats',stats);
0091
0092
0093
0094 if (plot.delay == 1)
0095
0096 plot(stats.pdf_delay_std)
0097
0098
0099
0100
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
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131 end
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143