user_msg

PURPOSE ^

attributes generated messages to mobiles

SYNOPSIS ^

function [mob,msg_mcn,msg_std] = user_msg(par,mob,msg_mcn,msg_std,t)

DESCRIPTION ^

 attributes generated messages to mobiles

  INPUT
   par        parameters structure
   mob        mobiles structure
   msg        messages structure
   t          iteration time

  OUTPUT
   mob        mobiles structure
   msg        messages structure


 $Id: user_msg.m,v 1.5 2004/07/16 03:47:04 dalai Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % attributes generated messages to mobiles
0002 %
0003 %  INPUT
0004 %   par        parameters structure
0005 %   mob        mobiles structure
0006 %   msg        messages structure
0007 %   t          iteration time
0008 %
0009 %  OUTPUT
0010 %   mob        mobiles structure
0011 %   msg        messages structure
0012 %
0013 %
0014 % $Id: user_msg.m,v 1.5 2004/07/16 03:47:04 dalai Exp $
0015 
0016 function [mob,msg_mcn,msg_std] = user_msg(par,mob,msg_mcn,msg_std,t)
0017 
0018 for idx_mob=1:par.mob
0019     if par.poisson(t,idx_mob) > 0
0020         for idx_msg=size(msg_mcn,2)+1:size(msg_mcn,2)+par.poisson(t,idx_mob)
0021             msg_mcn(idx_msg).init_time=t;
0022             msg_mcn(idx_msg).init_mob=idx_mob;
0023             msg_mcn(idx_msg).time_delivered = nan;
0024             msg_mcn(idx_msg).nbr_hop = 0;
0025 
0026             msg_std(idx_msg).init_time=t;
0027             msg_std(idx_msg).init_mob=idx_mob;
0028             msg_std(idx_msg).time_delivered = nan;
0029             msg_std(idx_msg).nbr_hop = 0;
0030 
0031             mob(idx_mob).msg_mcn(idx_msg)=0;
0032             mob(idx_mob).msg_std(idx_msg)=0;
0033         end
0034     end
0035 end

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