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

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

?? sim_ashr.cc

?? 無限傳感器網絡的模擬環境
?? CC
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************* * @<title> Autonomic Self-Healing Routing Simulation </title>@ * * @<!-- Copyright 2006 Mark Lisee, Joel Branch, Gilbert (Gang) Chen, * Boleslaw K. Szymanski and Rensselaer Polytechnic Institute. * * Copyright 2003 Gilbert (Gang) Chen, Boleslaw K. Szymanski and * Rensselaer Polytechnic Institute. All worldwide rights reserved.  A * license to use, copy, modify and distribute this software for * non-commercial research purposes only is hereby granted, provided * that this copyright notice and accompanying disclaimer is not * modified or removed from the software. * * DISCLAIMER: The software is distributed "AS IS" without any express * or implied warranty, including but not limited to, any implied * warranties of merchantability or fitness for a particular purpose * or any warranty of non-infringement of any current or pending * patent rights. The authors of the software make no representations * about the suitability of this software for any particular * purpose. The entire risk as to the quality and performance of the * software is with the user. Should the software prove defective, the * user assumes the cost of all necessary servicing, repair or * correction. In particular, neither Rensselaer Polytechnic * Institute, nor the authors of the software are liable for any * indirect, special, consequential, or incidental damages related to * the software, to the maximum extent the law permits. -->@  * * @<h1> Wireless Sensor Network Simulation </h1>@ * * Building a wireless sensor network simulation in SENSE consists of * the following steps: * @<UL>@ * @<LI>@ Designing a sensor node component * @<LI>@ Constructing a sensor network derived from @CostSimEng@ * @<LI>@ Configuring the system and running the simulation * @</UL>@ *  * Here, we assume that all components needed by a sensor node component * are available from the component repository. If this is not the case, the user * must develop new components, as described by other @<a href=tutorial.html>tutorials</a>@. We should * also mention that the first step of designing a sensor node component * is not always necessary, if a standard sensor node is to be used. * * This first line of this source file demands that @HeapQueue@ must be * used as the priority queue for event management.  For wireless network * simulation, because of the inherent drawback of @CalendarQueue@, and also * because of the particular channel component being used, @HeapQueue@ * is often faster.  *******************************************************************/#define queue_t HeapQueue/******************************************************************* * This header file is absolutely required *******************************************************************/#include <ctime>#include "../../common/sense.h"/******************************************************************* * The following header files are necessary only if the corresponding * components are needed by the sensor node component *******************************************************************/#include "../../app/cbr.h"#include "../../mob/immobile.h"#include "../../net/ssab.h"#include "../../net/ssrv02.h"#include "../../mac/bcast_mac.h"#include "../../phy/transceiver.h"#include "../../phy/simple_channel.h"#include "../../energy/battery.h"#include "../../energy/power.h"/******************************************************************* * #cxxdef is similar to #define, except it is only recognized by the * CompC++ compiler.  The following two lines state that the flooding * component will be used for the network layer. These two macros * can also be overridden by command line macros definitions (whose * format is '-D<macro>=<something>'. *******************************************************************//******************************************************************* * For layer XXX, XXX_Struct is the accompanying class that defines * data structures and types used in that layer.  The reason we need a separate * class for this purpose is that each XXX is a component, and that due to * the particular way in which the CompC++ compiler was implemented * data structures and types defined inside any component is not accessible from * outside.  Therefore, for each layer XXX, we must define all those * data structures and types in XXX_Struct, and then derive component XXX  * from XXX_Struct. * * The following three lines state: * @<UL>@ * @<LI>@ The type of packets in the application layer is @CBR_Struct::packet_t@ * @<LI>@ The network layer passes application layer packets by reference (which may * be faster than by pointer, for @CBR_Struct::packet_t@ is small, so  *  @app_packet_t@ becomes the template parameter of @net_struct@; the type of packets * in the network layer is then @net_packet_t@. * @<LI>@ Now that @net_packet_t@ is more than a dozen bytes long, so it is better * to pass it by pointer, so @net_packet_t*@ instead of @net_packet_t@ becomes the * template parameter of the @MAC80211_Struct@; the type of packets in the mac layer * is then @mac_packet_t@.  Physical layers also use @mac_packet_t@, so there is no * need to define more packet types. * @</UL>@ * *******************************************************************/typedef CBR_Struct::packet_t app_packet_t;typedef SSRv02_Struct<app_packet_t>::packet_t net_packet_t;typedef BcastMAC_Struct<net_packet_t*>::packet_t mac_packet_t;/******************************************************************* * Now we can begin to define the sensor node component. First we * instantiate every subcomponent used by the node component. We need to * determine the template parameter type for each subcomponent, usually starting from  * the application layer. Normally the application layer component does not have any * template parameter.  * * This picture shows the internal structure of a sensor node. * * @<center><img src=sim_flooding_node.gif></center>@ *******************************************************************/component SensorNode : public TypeII{ public:  CBR		app;  SSRv02 <app_packet_t> net;  BcastMAC <net_packet_t*> mac;  // A transceiver that can transmit and receive at the same time (of course  // a collision would occur in such cases)  DuplexTransceiver < mac_packet_t > phy;  // Linear battery  SimpleBattery battery;  // PowerManagers manage the battery  PowerManager	pm;  // sensor nodes are immobile  Immobile	mob;      double	MaxX, MaxY;  // coordinate boundaries  ether_addr_t	MyEtherAddr; // the ethernet address of this node  int		ID; // the identifier  bool		SrcOrDst;  virtual ~SensorNode();  void		Start();  void		Stop();  void		Setup( double txPower);/******************************************************************* * The following lines define one inport and two outports to be connected * to the channel components. *******************************************************************/  outport void to_channel_packet(mac_packet_t* packet, double power, int id);  inport void from_channel (mac_packet_t* packet, double power);  outport void to_channel_pos(coordinate_t& pos, int id);};SensorNode::~SensorNode(){}void SensorNode::Start(){}void SensorNode::Stop(){}/******************************************************************* * This function must be called before running the simulation. *******************************************************************/void SensorNode::Setup(  double	txPower){/******************************************************************* * At the beginning the amount of energy in each battery is 1,000,000 Joules. *******************************************************************/  battery.InitialEnergy = 1e6;    /******************************************************************* * Each subcomponent must also know the ethernet address of the  * sensor node it resides on. * Remember the application layer is a CBR component, which would stop * at FinishTime to give the whole network an opportunity to clean up * any packets in transit. * Assiging @false@ to @app.DumpPackets@ means that if @<a href=manual.html#COST_DEBUG>COST_DEBUG</a>@ * is defined, @app@ still won't print out anything. *******************************************************************/      app.MyEtherAddr = MyEtherAddr;  app.FinishTime = StopTime()*0.9;  app.DumpPackets = false;    /******************************************************************* * Set the coordinate of the sensor node.  Must also give @ID@ to @mob@ * since @ID@ was used to identify the index of the sensor node when * the position info is sent to the channel component. *******************************************************************/  mob.InitX = Random(MaxX);  mob.InitY = Random(MaxY);  mob.ID = ID;/******************************************************************* * When a net component is about to retransmit a packet that it received, * it cannot do so because otherwise all nodes that received the packet * may attempt to retransmit the packet immediately, inevitably resulting * in a collision.  @ForwardDelay@ gives the maximum delay time a  * needed-to-be-retransmit packet may incur.  The actual delay is randomly * chosen between [0,@ForwardDelay@]. *******************************************************************/  net.MyEtherAddr = MyEtherAddr;  net.ForwardDelay = 0.1;  net.AckWindow = 0.0015;  net.DumpPackets = true;  net.MaxResend = 3;  net.TimeToLive = 15;  net.AdditionalHop = 4;    /******************************************************************* * If @Promiscuity@ is ture, then the mac component will forward every packet * even if it not destined to this sensor node, to the network layer. * And we want to debug the mac layer, so we set @mac.DumpPackets@ to true. *******************************************************************/   mac.MyEtherAddr = MyEtherAddr;  mac.Promiscuity = true;  mac.DumpPackets = false;  mac.IFS = 0.01;   /******************************************************************* *  The PowerManager takes care of power consumption at different states. *  The following lines state the power consumption is 1.6W at transmission *  state, 1.2 at receive state, and 1.115 at idle state. *******************************************************************/  pm.TXPower = 1.6;  pm.RXPower = 1.2;  pm.IdlePower = 1.15;/******************************************************************* *  @phy.TxPower@ is the transmission power of the antenna. *  @phy.RXThresh@ is the lower bound on the receive power of any packet *  that can be successfuly received. *  @phy.CSThresh@ is the lower bound on tye receive power of any packet *  that can be detected. *  @phy@ also needs to know the id because it needs to communicate with *  the channel component. *******************************************************************/  phy.TXPower = txPower;  phy.TXGain = 1.0;  phy.RXGain = 1.0;   phy.Frequency = 9.14e8;  phy.RXThresh = 3.652e-10;  phy.CSThresh = 1.559e-11;  phy.ID = ID;  net.RXThresh = phy.RXThresh;/******************************************************************* *  Now we can establish the connections between components.  The connections *  will become much clearer if we look at the diagram. *******************************************************************/  connect app.to_transport, net.from_transport;  connect net.to_transport, app.from_transport;      connect mac.to_network_data, net.from_mac_data;  connect mac.to_network_ack, net.from_mac_ack;  connect net.to_mac, mac.from_network;  connect net.cancel, mac.cancel;  connect mac.to_network_recv_recv_coll, net.from_mac_recv_recv_coll;      connect mac.to_phy, phy.from_mac;  connect phy.to_mac, mac.from_phy;  connect phy.to_power_switch, pm.switch_state;  connect pm.to_battery_query, battery.query_in;  connect pm.to_battery_power, battery.power_in;/******************************************************************* *  These three connect statements are different.  All above ones *  are between an outport of a subcomponent and an outport of another *  subcomponent, while these three are between a port of the sensor *  node and a port of a subcomponent.  We can view these connections *  as mapping from the ports of subcomponents to its own ports, i.e., *  to expose the ports of internal components. *  Also remember the connect statement is so designed that it can take *  only two ports, and that packets always flow through from the first port *  to the second port, so when connection two inports, the inport of *  the subcomponent must be placed in the second place. *******************************************************************/  connect phy.to_channel, to_channel_packet;  connect mob.pos_out, to_channel_pos;  connect from_channel, phy.from_channel;  SrcOrDst = false;}/******************************************************************* *  Once we have the sensor node component ready, we can start to  *  build the entire simulation, which is named @RoutingSim@.  It must *  be derived from the simulation engine class @CostSimEng@. *  This is the structure of the network. * * @<center><img src=sim_flooding_net.gif></center>@ *******************************************************************/component RoutingSim : public CostSimEng{ public:  void		Start();  void		Stop();		RoutingSim();/******************************************************************* *  These are simulation parameters.  We don't want configurators of *  the simulation to access the parameters of those inter-components. *******************************************************************/  double	MaxX, MaxY;  int		NumNodes;  int		NumSourceNodes;  int		NumConnections;  int		PacketSize;  double	Interval;  double	ActivePercent;  double	SlotWidth;  double	TransitionTime;  int		NumT2Slots;  int		NumT3Slots;  double	TXPower;/******************************************************************* *  Here we declare sense nodes as an array of @SensorNode@, and a *  channel component. *******************************************************************/  SensorNode[]	nodes;  SimpleChannel < mac_packet_t > channel;  void		Setup();};RoutingSim::RoutingSim(){  NumConnections = 1;  PacketSize = 1000;  StopTime = 1000;  NumNodes = 110;  MaxX = MaxY = 2000;  NumSourceNodes = 0;  ActivePercent = 1.0;  Interval = 20.0;  SlotWidth = 0.001;  TransitionTime = 0.0;  NumT2Slots = DefaultNumT2Slots;  NumT3Slots = DefaultNumT3Slots;  TXPower=0.0280;  return;}void RoutingSim :: Start(){}/******************************************************************* *  After the simulation is stopped, we will collect some statistics. *******************************************************************/void RoutingSim :: Stop(){  int		i, j, sent, recv, samples, recv_data, hopCounts[ HCArraySize];  double	hop;  double	app_recv;  double	delay;  int		T2PktsSent[ MaxT2Slots], T1PktsSent, T3PktsSent[ MaxT3Slots];  int		dropPkts, t3AbnormalPktsSent = 0;  int		T2Colls[ MaxT2Slots], T1Colls, T3Colls[ MaxT3Slots], IgnColls;  int		numCollisions;  int		T1PktsRcvd[2];  int		T2PktsRcvd[2][ MaxT2Slots];  int		T3PktsRcvd[2][ MaxT3Slots];  int		T4PktsRcvd[2];  int		CanceledPktsRcvd[2];  int		BadAddrPktsRcvd[2];  int		WrongHopPktsRcvd[2];  for(sent=recv=i=0,delay=0.0;i<NumNodes;i++)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区黄| 亚洲第四色夜色| 丝袜亚洲另类欧美综合| 国产传媒一区在线| 欧美三级电影网| 国产精品成人免费在线| 蜜臂av日日欢夜夜爽一区| 91麻豆自制传媒国产之光| 精品99久久久久久| 日韩中文字幕1| 色94色欧美sute亚洲线路一ni| 日韩一区二区三| 亚洲一卡二卡三卡四卡五卡| 成人av免费在线| 久久婷婷国产综合国色天香| 天堂午夜影视日韩欧美一区二区| 99久久精品免费看国产| 久久亚洲综合色| 久久国产夜色精品鲁鲁99| 欧美人xxxx| 亚洲一区中文日韩| 99久久久精品| 亚洲色图清纯唯美| 成人小视频在线观看| 久久婷婷色综合| 国产一区二区三区蝌蚪| 制服丝袜av成人在线看| 午夜久久久久久电影| 欧美性三三影院| 亚洲宅男天堂在线观看无病毒| 日本二三区不卡| 樱花草国产18久久久久| 色婷婷久久久综合中文字幕| 中文字幕综合网| 91捆绑美女网站| 亚洲欧美成人一区二区三区| 色av一区二区| 亚洲成人你懂的| 91精品欧美一区二区三区综合在 | 色哟哟欧美精品| 最新久久zyz资源站| 不卡一区二区在线| 亚洲视频1区2区| 一本色道**综合亚洲精品蜜桃冫| 伊人性伊人情综合网| 色噜噜狠狠成人中文综合| 亚洲国产精品视频| 3atv一区二区三区| 国产九九视频一区二区三区| 日本一区二区视频在线观看| jvid福利写真一区二区三区| 一区二区三区丝袜| 欧美区视频在线观看| 久久精品免费观看| 欧美国产视频在线| 欧美亚洲一区二区三区四区| 视频一区国产视频| 久久精品免视看| 91国偷自产一区二区使用方法| 一区av在线播放| 日韩一区二区麻豆国产| 成人黄色在线视频| 无吗不卡中文字幕| 久久精品日韩一区二区三区| aa级大片欧美| 日本伊人精品一区二区三区观看方式| 日韩欧美国产系列| www.日韩av| 日本免费新一区视频 | 欧美一区二区在线免费播放 | 日韩精品视频网| 精品国产免费一区二区三区四区| 成人激情免费视频| 精品一区二区三区在线视频| 国产精品成人一区二区三区夜夜夜| 欧美人狂配大交3d怪物一区| 国产suv一区二区三区88区| 亚洲国产成人porn| 中文字幕第一区综合| 欧美日韩激情一区二区三区| 国产麻豆精品一区二区| 午夜久久电影网| 国产精品久久久久一区二区三区 | 日韩精品91亚洲二区在线观看| 久久亚洲综合av| 91精品国产色综合久久不卡蜜臀| www.日韩av| 国产精品一区不卡| 日本不卡一二三| 亚洲人成电影网站色mp4| 2020国产精品自拍| 在线不卡一区二区| 91丨porny丨蝌蚪视频| 国产中文一区二区三区| 亚洲成人一二三| 一区二区三区国产精华| 国产精品乱人伦| 精品国产亚洲在线| 日韩精品在线看片z| 欧美狂野另类xxxxoooo| 欧美色图激情小说| 在线欧美日韩国产| 99热99精品| 高清不卡一区二区在线| 激情综合网av| 精品一区二区免费视频| 男女激情视频一区| 午夜视黄欧洲亚洲| 天堂av在线一区| 亚洲123区在线观看| 一区二区高清视频在线观看| 伊人色综合久久天天| 专区另类欧美日韩| 亚洲特黄一级片| 亚洲乱码国产乱码精品精小说 | 97久久超碰精品国产| 丁香六月综合激情| 99精品欧美一区二区三区小说| 成人爱爱电影网址| 99精品欧美一区二区三区小说| av电影天堂一区二区在线观看| 91麻豆产精品久久久久久| 91官网在线观看| 欧美日韩在线亚洲一区蜜芽| 欧美日韩国产一二三| 日韩一区二区在线观看视频| 精品久久人人做人人爰| 日本一区二区三区四区在线视频 | av成人免费在线观看| 一本大道久久精品懂色aⅴ| 日本国产一区二区| 欧美猛男男办公室激情| 91精品国产色综合久久不卡电影 | 日韩久久精品一区| 欧美激情一区二区三区全黄| 亚洲欧美日韩中文字幕一区二区三区| 亚洲一区二区免费视频| 免费久久精品视频| 成人动漫中文字幕| 91成人看片片| 精品免费国产一区二区三区四区| 久久久精品国产免大香伊| 自拍偷拍亚洲综合| 日韩精品福利网| 99视频在线精品| 欧美一级片在线观看| 国产精品天干天干在线综合| 一区二区欧美视频| 精品伊人久久久久7777人| 91小视频免费看| 日韩一区二区三区四区五区六区 | 国产成人av一区| 欧美日韩国产免费| 中文字幕精品一区二区三区精品| 亚洲国产视频一区| 国产91精品在线观看| 欧美日韩国产精选| 国产无人区一区二区三区| 亚洲国产精品天堂| 懂色av中文一区二区三区| 88在线观看91蜜桃国自产| 国产日韩欧美不卡在线| 午夜精品一区二区三区免费视频| 国产电影一区在线| 91精品国产aⅴ一区二区| 国产精品精品国产色婷婷| 日韩制服丝袜av| 色先锋aa成人| 国产日韩成人精品| 免费在线观看成人| 95精品视频在线| 久久无码av三级| 日本欧美一区二区在线观看| 色婷婷亚洲综合| 中文字幕av不卡| 精品在线一区二区| 7777精品伊人久久久大香线蕉经典版下载| 国产欧美日韩激情| 国产精品中文字幕一区二区三区| 欧美日韩视频一区二区| 亚洲激情在线播放| av不卡在线播放| 国产精品传媒入口麻豆| 国产99精品在线观看| 2020国产精品久久精品美国| 美女一区二区三区在线观看| 欧美美女激情18p| 午夜一区二区三区在线观看| 色成人在线视频| 亚洲精品伦理在线| 在线影院国内精品| 亚洲美女视频在线观看| 成人激情综合网站| 国产精品久久一级| 成人av网站免费观看| 国产精品家庭影院| 一本久道中文字幕精品亚洲嫩| 日韩码欧中文字| 色婷婷久久久综合中文字幕| 亚洲精品免费播放|