⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initsim.m

📁 用于网络控制系统仿真
💻 M
字号:
clear functionsrand('state',0);nbrNodes = 7;% Lots of printouts or just a few?global verboseverbose = 0; % Initialize routing table (7 nodes)global routing_tablefor k=1:nbrNodes  routing_table{k} = [];end  % Initialize AODV sequence numbersglobal seqNbrsseqNbrs = zeros(nbrNodes, nbrNodes);% Initialize AODV parametersglobal AODVparamsAODVparams.ACTIVE_ROUTE_TIMEOUT = 3; % 3000 msecAODVparams.MY_ROUTE_TIMEOUT = 2 * AODVparams.ACTIVE_ROUTE_TIMEOUT;AODVparams.HELLO_INTERVAL = 1; % 1000 msecAODVparams.ALLOWED_HELLO_LOSS = 2;AODVparams.DELETE_PERIOD = AODVparams.ALLOWED_HELLO_LOSS * AODVparams.HELLO_INTERVAL;% Initialize node positions, transmission power, and thresholdsglobal xPos yPos pow thres% X positionsxPos(1) = -15;xPos(2) = -10;xPos(3) = -5;xPos(4) =  0;xPos(5) =  5;xPos(6) =  5;xPos(7) =  15;% Y positionsyPos(1) =  5;yPos(2) = -5;yPos(3) =  10;yPos(4) = -5;yPos(5) =  5;yPos(6) = -10;yPos(7) =  5;pow = -8; % dBmthres = -48;codethres = 0.03;% To track sent (from node 1) and % received (in node 7) dataglobal sentsent = [];global receivedreceived = [];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -