simulhope_run

PURPOSE ^

performs the simulation

SYNOPSIS ^

function [par,bs,mob,msg_mcn,msg_std] = simulhope_run(par)

DESCRIPTION ^

 performs the simulation

  INPUT
   par          parameters structure

  OUTPUT
   par          parameters structure
   bs           base-stations structure
   mob          mobiles structure
   msg          messages structure


 $Id: simulhope_run.m,v 1.25 2004/07/16 03:52:07 dalai Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % performs the simulation
0002 %
0003 %  INPUT
0004 %   par          parameters structure
0005 %
0006 %  OUTPUT
0007 %   par          parameters structure
0008 %   bs           base-stations structure
0009 %   mob          mobiles structure
0010 %   msg          messages structure
0011 %
0012 %
0013 % $Id: simulhope_run.m,v 1.25 2004/07/16 03:52:07 dalai Exp $
0014 
0015 function [par,bs,mob,msg_mcn,msg_std] = simulhope_run(par)
0016 
0017 % initation
0018 [par,bs,mob,msg_mcn,msg_std] = simulhope_init(par);
0019 
0020 % create the graphical waitbar if GUI mode
0021 if (par.ui==1)
0022     wait = waitbar(0,sprintf('Processing %s model...',char(par.models(par.model))),'Name','please wait');
0023 end
0024 
0025 tic;
0026 
0027 % init time for the waitleftconsole
0028 init_simu = clock;
0029 
0030 % the simulation loop over time
0031 for t=1:par.tmax
0032     % init time for the waitleftconsole
0033     init_loop = clock;
0034 
0035     % move the users
0036     mob = user_move(par,mob,t);
0037 
0038     % users generate messages
0039     [mob,msg_mcn,msg_std] = user_msg(par,mob,msg_mcn,msg_std,t);
0040 
0041     % update the user buffer stats
0042     mob = user_buffer(par,mob,t);
0043 
0044     % transmissions
0045     [mob,msg_mcn,msg_std] = transmit_bs(par,bs,mob,msg_mcn,msg_std,t);
0046     [mob,msg_mcn] = transmit_user(par,mob,msg_mcn,t);
0047     
0048     if (par.ui==1)
0049         waitbar(t/par.tmax);
0050     else
0051         waitleftconsole(t,1,1,par.tmax,init_simu,init_loop);
0052     end
0053 end
0054 
0055 if (par.ui == 1)
0056     close(wait);
0057 end
0058 
0059 proctime = sec2hms(toc);
0060 
0061 disp(dispconsole('|','=','|'));
0062 disp(dispconsole('|','Infos about simulation','','','|'));
0063 disp(dispconsole('|','=','|'));
0064 disp(dispconsole('|','simulation processed in',':',[num2str(proctime(1)) 'h ' num2str(proctime(2)) 'min ' num2str(proctime(3)) 's'],'|'));
0065 disp(dispconsole('|','number of messages generated',':',num2str(par.msg),'|'));

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