亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wireless-phy.cc

?? 這個市一個ns環境下的leach算法!大家可以多下在啊!我想要一個matlab環境下的概算法!
?? CC
?? 第 1 頁 / 共 2 頁
字號:
/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*-  * * Copyright (c) 1996 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the Computer Systems *	Engineering Group at Lawrence Berkeley Laboratory and the Daedalus *	research group at UC Berkeley. * 4. Neither the name of the University nor of the Laboratory may be used *    to endorse or promote products derived from this software without *    specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Header: /nfs/jade/vint/CVSROOT/ns-2/mac/wireless-phy.cc,v 1.20 2003/11/19 00:41:44 haldar Exp $ * * Ported from CMU/Monarch's code, nov'98 -Padma Haldar. * wireless-phy.cc */#include <math.h>#include <packet.h>#include <mobilenode.h>#include <phy.h>#include <propagation.h>#include <modulation.h>#include <omni-antenna.h>#include <wireless-phy.h>#include <packet.h>#include <ip.h>#include <agent.h>#include <trace.h>#include "diffusion/diff_header.h"#define max(a,b) (((a)<(b))?(b):(a))void Idle_Timer::expire(Event *) {	a_->UpdateIdleEnergy();}/* ======================================================================   WirelessPhy Interface   ====================================================================== */static class WirelessPhyClass: public TclClass {public:        WirelessPhyClass() : TclClass("Phy/WirelessPhy") {}        TclObject* create(int, const char*const*) {                return (new WirelessPhy);        }} class_WirelessPhy;WirelessPhy::WirelessPhy() : Phy(), idle_timer_(this), status_(IDLE){	/*	 *  It sounds like 10db should be the capture threshold.	 *	 *  If a node is presently receiving a packet a a power level	 *  Pa, and a packet at power level Pb arrives, the following	 *  comparion must be made to determine whether or not capture	 *  occurs:	 *	 *    10 * log(Pa) - 10 * log(Pb) > 10db	 *	 *  OR equivalently	 *	 *    Pa/Pb > 10.	 *	 */#ifdef MIT_uAMPS  alive_ = 1;   	// 0 = dead, 1 = alive  bandwidth_ = 1000000;                // 100 Mbps  Efriss_amp_ = 100 * 1e-12;           // Friss amp energy (J/bit/m^2)  Etwo_ray_amp_ = 0.013 * 1e-12;       // Two-ray amp energy (J/bit/m^4)  EXcvr_ = 50 * 1e-9;                  // Xcvr energy (J/bit)  // Use this base threshold to get a "hearing radius" of ~ 1 m  Pfriss_amp_ = Efriss_amp_ * bandwidth_;      // Friss power (W/m^2)  Ptwo_ray_amp_ = Etwo_ray_amp_ * bandwidth_;  // Two-ray power (W/m^4)  PXcvr_ = EXcvr_ * bandwidth_;        // Xcvr power (W)  sleep_ = 0;                          // 0 = awake, 1 = asleep  ss_ = 1;                             // amount of spreading  time_finish_rcv_ = 0;                              dist_ = 0;                           // approx. distance to transmitter   energy_ = 0;   #else  bandwidth_ = 2*1e6;                 // 2 Mb  Pt_ = pow(10, 2.45) * 1e-3;         // 24.5 dbm, ~ 281.8mw#endif	#ifdef MIT_uAMPS  /*   * Set CSThresh_ for receiver sensitivity and RXThresh_ for required SNR.   */  CSThresh_ = 1e-10;  RXThresh_ = 6e-9;#else  CSThresh_ = 1.559e-11;  RXThresh_ = 3.652e-10;#endif    bind("CPThresh_", &CPThresh_);  bind("CSThresh_", &CSThresh_);  bind("RXThresh_", &RXThresh_);  //bind("bandwidth_", &bandwidth_);  bind("Pt_", &Pt_);  bind("freq_", &freq_);  bind("L_", &L_);#ifdef MIT_uAMPS  bind("alive_",&alive_);  bind("bandwidth_",&bandwidth_);  bind("Efriss_amp_", &Efriss_amp_);  bind("Etwo_ray_amp_", &Etwo_ray_amp_);  bind("EXcvr_", &EXcvr_);   bind("sleep_",&sleep_);  bind("ss_",&ss_);  bind("dist_",&dist_);#endif		lambda_ = SPEED_OF_LIGHT / freq_;	node_ = 0;	ant_ = 0;	propagation_ = 0;	modulation_ = 0;	// Assume AT&T's Wavelan PCMCIA card -- Chalermek        //	Pt_ = 8.5872e-4; // For 40m transmission range.	//      Pt_ = 7.214e-3;  // For 100m transmission range.	//      Pt_ = 0.2818; // For 250m transmission range.	//	Pt_ = pow(10, 2.45) * 1e-3;         // 24.5 dbm, ~ 281.8mw		Pt_consume_ = 0.660;  // 1.6 W drained power for transmission	Pr_consume_ = 0.395;  // 1.2 W drained power for reception	//	P_idle_ = 0.035; // 1.15 W drained power for idle	P_idle_ = 0.0;	channel_idle_time_ = NOW;	update_energy_time_ = NOW;	last_send_time_ = NOW;		idle_timer_.resched(1.0);}intWirelessPhy::command(int argc, const char*const* argv){	TclObject *obj; 	if (argc==2) {		if (strcasecmp(argv[1], "NodeOn") == 0) {			if (em() == NULL) 				return TCL_OK;			if (NOW > update_energy_time_) {				update_energy_time_ = NOW;			}			return TCL_OK;		} else if (strcasecmp(argv[1], "NodeOff") == 0) {			if (em() == NULL) 				return TCL_OK;			if (NOW > update_energy_time_) {				em()->DecrIdleEnergy(NOW-update_energy_time_,						     P_idle_);				update_energy_time_ = NOW;			}			return TCL_OK;		}	} else if(argc == 3) {		if (strcasecmp(argv[1], "setTxPower") == 0) {			Pt_consume_ = atof(argv[2]);			return TCL_OK;		} else if (strcasecmp(argv[1], "setRxPower") == 0) {			Pr_consume_ = atof(argv[2]);			return TCL_OK;		} else if (strcasecmp(argv[1], "setIdlePower") == 0) {			P_idle_ = atof(argv[2]);			return TCL_OK;		} else if( (obj = TclObject::lookup(argv[2])) == 0) {			fprintf(stderr,"WirelessPhy: %s lookup of %s failed\n", 				argv[1], argv[2]);			return TCL_ERROR;		} else if (strcmp(argv[1], "propagation") == 0) {			assert(propagation_ == 0);			propagation_ = (Propagation*) obj;			return TCL_OK;		} else if (strcasecmp(argv[1], "antenna") == 0) {			ant_ = (Antenna*) obj;			return TCL_OK;		} else if (strcasecmp(argv[1], "node") == 0) {			assert(node_ == 0);			node_ = (MobileNode *)obj;			return TCL_OK;		}#ifdef MIT_uAMPS    else if (strcasecmp(argv[1], "attach-energy") == 0) {      energy_ = (EnergyResource*) obj;      return TCL_OK;    }#endif	}	return Phy::command(argc,argv);} void WirelessPhy::sendDown(Packet *p){	/*	 * Sanity Check	 */	assert(initialized());#ifdef MIT_uAMPS  /*    * The power for transmission depends on the distance between   * the transmitter and the receiver.  If this distance is   * less than the crossover distance:   *       (c_d)^2 =  16 * PI^2 * L * hr^2 * ht^2   *               ---------------------------------   *                           lambda^2   * the power falls off using the Friss equation.  Otherwise, the   * power falls off using the two-ray ground reflection model.   * Therefore, the power for transmission of a bit is:   *      Pt = Pfriss_amp_*d^2 if d < c_d   *      Pt = Ptwo_ray_amp_*d^4 if d >= c_d.    * The total power dissipated per bit is PXcvr_ + Pt.   */  hdr_cmn *ch = HDR_CMN(p);  hdr_rca *rca_hdr = HDR_RCA(p);  double d = rca_hdr->get_dist();  double hr, ht;        // height of recv and xmit antennas  double tX, tY, tZ;    // transmitter location   node_->getLoc(&tX, &tY, &tZ);   ht = tZ + ant_->getZ();  hr = ht;              // assume receiving node and antenna at same height  double crossover_dist = sqrt((16 * PI * PI * L_ * ht * ht * hr * hr)                              / (lambda_ * lambda_));  if (d < crossover_dist)     if (d > 1)       Pt_ = Efriss_amp_ * bandwidth_ * d * d;    else       // Pfriss_amp_ is the minimum transmit amplifier power.      Pt_ = Efriss_amp_ * bandwidth_;  else    Pt_ = Etwo_ray_amp_ * bandwidth_ * d * d * d * d;  PXcvr_ = EXcvr_ * bandwidth_;  if (energy_)  {     if (energy_->remove(pktEnergy(Pt_, PXcvr_, ch->size())) != 0)       alive_ = 0;  }#endif		if (em()) 		if ((em()->node_on() != true) || (em()->sleep())) {			Packet::free(p);			return;		}	/*	 * Decrease node's energy	 */	if(em()) {		if (em()->energy() > 0) {			//double txtime = (8.*hdr_cmn::access(p)->size())/bandwidth_;		    double txtime = hdr_cmn::access(p)->txtime();		    double start_time = max(channel_idle_time_, NOW);		    double end_time = max(channel_idle_time_, NOW+txtime);		    double actual_txtime = end_time-start_time;		    if (start_time > update_energy_time_) {			    em()->DecrIdleEnergy(start_time - 						 update_energy_time_, P_idle_);			    update_energy_time_ = start_time;		    }		    /* It turns out that MAC sends packet even though, it's		       receiving some packets.		    		    if (txtime-actual_txtime > 0.000001) {			    fprintf(stderr,"Something may be wrong at MAC\n");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区蜜桃臀影院| 在线观看一区二区视频| 久久综合狠狠综合久久综合88| 奇米精品一区二区三区四区| 91精品一区二区三区久久久久久| 日本不卡的三区四区五区| 日韩亚洲欧美在线| 国产成人在线视频网站| 中文字幕一区二区三区不卡在线| 99精品欧美一区二区三区综合在线| 亚洲三级久久久| 欧美日韩精品一区二区三区四区| 免费在线观看视频一区| 久久日韩粉嫩一区二区三区| 丁香一区二区三区| 亚洲午夜在线视频| 欧美r级在线观看| 成人免费看黄yyy456| 一区二区三区在线观看欧美| 欧美日韩小视频| 国产一区二区免费视频| 亚洲色图另类专区| 日韩欧美一二三| 本田岬高潮一区二区三区| 亚洲成av人综合在线观看| 精品久久久久一区二区国产| 丁香六月久久综合狠狠色| 亚洲成av人片在线| 欧美精品一区二区三区蜜臀| av不卡在线观看| 日韩不卡一区二区三区| 国产日本一区二区| 欧美浪妇xxxx高跟鞋交| 国产剧情一区二区三区| 亚洲一级二级三级| 中文字幕精品—区二区四季| 欧美日韩激情一区二区| 成人免费视频播放| 精品一区二区三区在线视频| 亚洲日本丝袜连裤袜办公室| 欧美va亚洲va| 欧美日韩成人综合在线一区二区| 国产成人一区在线| 日本欧美一区二区三区| 亚洲视频1区2区| 久久日韩精品一区二区五区| 欧美日韩综合不卡| av不卡一区二区三区| 激情综合一区二区三区| 天堂一区二区在线| 综合电影一区二区三区 | 色网站国产精品| 韩国一区二区视频| 日韩在线卡一卡二| 亚洲一区免费在线观看| 欧美经典三级视频一区二区三区| 91精品国产一区二区三区香蕉 | 亚洲视频免费在线观看| 久久久精品黄色| 欧美成人bangbros| 欧美美女喷水视频| 欧美视频完全免费看| 99久久伊人精品| 国产一区美女在线| 激情六月婷婷综合| 激情偷乱视频一区二区三区| 秋霞午夜av一区二区三区| 亚洲成人久久影院| 亚洲va欧美va人人爽午夜| 亚洲精品ww久久久久久p站| 日韩一区欧美一区| 亚洲天堂久久久久久久| 国产精品对白交换视频| 国产亚洲综合在线| 国产欧美日韩综合| 国产精品久久精品日日| 国产精品久久久久久久久搜平片 | 国产精品成人在线观看| 中文字幕免费不卡在线| 国产精品视频麻豆| 国产精品成人免费 | 亚洲乱码国产乱码精品精98午夜| 中文字幕精品在线不卡| 亚洲欧洲国产日韩| 一区二区三区国产精华| 亚洲制服丝袜一区| 丝袜亚洲精品中文字幕一区| 日韩中文欧美在线| 九九国产精品视频| 成人综合激情网| 91丨九色丨蝌蚪丨老版| 日本伦理一区二区| 555夜色666亚洲国产免| 欧美mv日韩mv国产网站app| 久久久不卡影院| 综合激情成人伊人| 午夜在线电影亚洲一区| 免费看欧美美女黄的网站| 国产剧情一区在线| 色婷婷精品久久二区二区蜜臂av| 欧美性感一区二区三区| 日韩一级片在线播放| 久久一日本道色综合| 国产精品国产精品国产专区不蜜| 亚洲欧美另类小说| 日韩高清一区二区| 成人激情文学综合网| 在线观看日韩高清av| 日韩欧美国产一区在线观看| 国产精品视频看| 亚洲18色成人| 国产一区二区不卡| 欧亚一区二区三区| www激情久久| 一区二区高清视频在线观看| 日韩精品一区第一页| 成人免费观看视频| 91精品国产色综合久久ai换脸 | av在线这里只有精品| 欧美高清视频在线高清观看mv色露露十八 | 精品国产乱码久久久久久牛牛| 国产日本欧美一区二区| 午夜激情久久久| 成人高清免费观看| 日韩一区二区免费高清| 国产精品久久综合| 免费成人小视频| 日本道免费精品一区二区三区| 欧美成人乱码一区二区三区| 一区二区三区精品视频在线| 国产自产2019最新不卡| 欧美日韩1区2区| 亚洲欧洲精品一区二区三区不卡| 美日韩一区二区| 一本一本大道香蕉久在线精品| 26uuu久久综合| 天天操天天干天天综合网| 不卡的av网站| 久久欧美一区二区| 另类综合日韩欧美亚洲| 91福利视频久久久久| 国产精品三级视频| 国产在线看一区| 欧美高清dvd| 亚洲一区国产视频| 99精品久久只有精品| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲国产精品成人综合色在线婷婷| 天堂成人免费av电影一区| 91福利在线观看| 亚洲欧美电影院| www.欧美日韩| 国产精品久久久久久久久动漫 | 国产福利电影一区二区三区| 欧美日韩电影在线播放| 亚洲亚洲精品在线观看| 色综合久久久网| 亚洲精品中文在线观看| 99久久综合国产精品| 国产精品乱人伦| 成人免费黄色大片| 国产精品久久久久久久裸模| 国产精品综合av一区二区国产馆| 精品国产百合女同互慰| 久久99精品一区二区三区| 日韩一区二区电影在线| 麻豆国产精品官网| 日韩欧美高清在线| 精品在线一区二区| 欧美成人精品福利| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美精品在线视频| 日本伊人色综合网| 欧美白人最猛性xxxxx69交| 麻豆国产精品777777在线| 精品欧美久久久| 国产麻豆精品在线观看| 亚洲国产精品99久久久久久久久| 成人一区二区三区视频在线观看 | 洋洋av久久久久久久一区| 91美女福利视频| 亚洲妇女屁股眼交7| 欧美精三区欧美精三区| 免费高清在线一区| 久久久久久久久久久久电影| 成人黄色片在线观看| 亚洲乱码中文字幕综合| 欧美猛男男办公室激情| 六月丁香综合在线视频| 国产人成一区二区三区影院| 成人av免费在线播放| 亚洲一区二区三区四区在线免费观看| 欧美日韩在线播放| 麻豆91在线播放免费| 国产精品色哟哟| 欧美性猛交xxxx乱大交退制版| 毛片av一区二区| 国产精品欧美久久久久无广告 | 99久久精品免费| 午夜一区二区三区视频|