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

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

?? asim.cc

?? NS2網絡仿真軟件是目前最為流行的網絡仿真模擬軟件
?? CC
?? 第 1 頁 / 共 2 頁
字號:
/* * asim.cc * Copyright (C) 2000 by the University of Southern California * $Id: asim.cc,v 1.11 2005/08/25 18:58:01 johnh Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * * The copyright of this module includes the following * linking-with-specific-other-licenses addition: * * In addition, as a special exception, the copyright holders of * this module give you permission to combine (via static or * dynamic linking) this module with free software programs or * libraries that are released under the GNU LGPL and with code * included in the standard release of ns-2 under the Apache 2.0 * license or under otherwise-compatible licenses with advertising * requirements (or modified versions of such code, with unchanged * license).  You may copy and distribute such a system following the * terms of the GNU GPL for this module and the licenses of the * other code concerned, provided that you include the source code of * that other code when and as the GNU GPL requires distribution of * source code. * * Note that people who make modified versions of this module * are not obligated to grant this special exception for their * modified versions; it is their choice whether to do so.  The GNU * General Public License gives permission to release a modified * version without this exception; this exception also makes it * possible to release a modified version which carries forward this * exception. * */#include "config.h"#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>//#include <strings.h>#include <assert.h>#include <iostream>#include "agent.h"// Integration of Ashish's RED and asim#define _RED_ROUTER_MAIN_#include "asim.h"#define sp " " typedef struct c{  int no; // no of edges in the connection  double delay; // total delay;  double drop; // total drop prob  double p_tput;  double t;  // The short flow stuff  int is_sflow; // boolean to indicate whether there is a short flow  double slambda; // The arrival rate of the connections  int snopkts; // average of no of packets each short flow givies  RedRouter * red;  int scaled; // Whether this flow has been scaled or not}flow_stats;typedef struct n{  int red; // flag to notify whether its a red queue or not  double pmin, pmax, minth, maxth; // RED parameters  double lambda; // Arrival rate - Packets per second  double plambda; // Temp lambda value. previous lambda  double tlambda;  double mu; // Consumption rate - Packets per second  double prop; // Propagation delay of the link  double qdelay; // Store the queuing delay for each link  int    buffer; // Total buffer  double drop; // probability of drop  int nflows; // Number of flows through this link  int *theflows; // The flows through this link  double scaled_lambda;  double unscaled_lambda;  double utput; // unscaled tput   double uc; // unscaled capacity  // For ashish  RedRouter * redrouter;}link_stats;class asim : public NsObject{public:  // data structures   int nConnections; // Number of connections  int K, MaxHops; //   int nLinks; // Number of links   int **Adj; // Stores the edge list of each connection  int *nAdj; // Stores the no of edges per connection    link_stats* links;  flow_stats* flows;    double min(double x, double y){    return (x<y)?x:y;  }  double padhye(double rtt, double p){        double rto = 1;    double t=1;    t = rtt*sqrt(2*p/3)+rto*min(1,(3*sqrt(3*p/8)))*p*(1+32*p*p);    return min(20/rtt,1/t);      }    double Po(double rho, int K){        if(rho==1)      return 1.0/(K+1);        double t;    t=(1.0*(1-rho))/(1.0-pow(rho,K));    return t;      }  double Pk(double rho, int K, int k){        if(rho==1)      return 1.0/(K+1);        double t;    t=(1-rho)*pow(rho,k);    t/=1-pow(rho,K+1);    return t;  }    double Lq(double rho, int K){    double t1,t2;        if(rho==1){      return (1.0*K*(K-1))/(2.0*(K+1));    }        t1=rho*1.0/(1-rho);    t2=rho*1.0/(1-pow(rho,K+1));    t2*=K*pow(rho,K)+1;    return (t1-t2)/2;      }    int command (int argc, const char*const* argv){    if (strcmp(argv[1], "run") == 0) {      int niter=0;      for(int i=0; i<20; i++){	CalcLinkDelays(1);	CalcPerFlowDelays();	newupdate(niter);      }      //PrintResults();        return (TCL_OK);    }        if (strcmp(argv[1], "readinput") == 0) {      GetInputs((char*)argv[2]);      //cout << "All inputs properly obtained from " << argv[2] <<endl ;       return (TCL_OK);    }    if (strcmp(argv[1], "get-link-drop") == 0) {      cout << "Hi";      Tcl& tcl = Tcl::instance();      tcl.resultf("%lf",get_link_drop(atoi(argv[2])));      return (TCL_OK);    }    if (strcmp(argv[1], "get-link-delay") == 0) {      Tcl& tcl = Tcl::instance();      tcl.resultf("%lf",get_link_delay(atoi(argv[2])));      return (TCL_OK);    }      if (strcmp(argv[1], "get-link-tput") == 0) {      Tcl& tcl = Tcl::instance();      tcl.resultf("%lf",get_link_tput(atoi(argv[2])));      return (TCL_OK);    }      if (strcmp(argv[1], "get-flow-tput") == 0) {      Tcl& tcl = Tcl::instance();      tcl.resultf("%lf",get_flow_tput(atoi(argv[2])));      return (TCL_OK);    }    if (strcmp(argv[1], "get-flow-delay") == 0) {      Tcl& tcl = Tcl::instance();      tcl.resultf("%lf",get_flow_delay(atoi(argv[2])));      return (TCL_OK);    }          if (strcmp(argv[1], "get-flow-drop") == 0) {      Tcl& tcl = Tcl::instance();      tcl.resultf("%lf",get_flow_drop(atoi(argv[2])));      return (TCL_OK);    }	return 0;  }    double get_link_drop(int x){    assert(x<nLinks);    return links[x].drop;  }  double get_link_delay(int x){    assert(x<nLinks);    return links[x].qdelay + links[x].prop ;  }  double get_link_qdelay(int x){    assert(x<nLinks);    return links[x].qdelay;  }  double get_link_pdelay(int x){    assert(x<nLinks);    return links[x].prop;  }  double get_link_tput(int x){    assert(x<nLinks);    return links[x].lambda;  }  double get_flow_delay(int x){    assert(x<nConnections);    return flows[x].delay;  }  double get_flow_tput(int x){    assert(x<nConnections);    return flows[x].p_tput;  }  double get_flow_drop(int x){    assert(x<nConnections);    return flows[x].drop;  }  void GetInputs(char *argv) {        // error if usage is wrong     /*        if (argc != 2) {      fprintf(stderr,"Usage: %s  <InputFile>\n", argv[0]);      exit(-1);       }*/      // No error   MaxHops = 0;  // K = atoi(argv[1]);  // assert(K >= 1);  // Init links and connections   nConnections = 0;  nLinks = 0;  // Start the reading process  FILE *f;  f = fopen(argv,"r");  assert(f);  char s[256];  while (fgets(s, 255, f)) {    // Read a token     char *t;    t = strtok(s, " \t\n");    // Ignore comments     if (!t || !t[0] || (t[0] == '#') || !strncasecmp(t, "comment", 6))      continue;        // Define the number of connections    if (!strcasecmp(t,"n")) {      t = strtok(NULL," \t");      assert(t);      nConnections = atoi(t);      assert(nConnections > 0);      assert(nConnections >= 0);      nAdj = new int[nConnections];      Adj = new int*[nConnections];      flows = new flow_stats[nConnections];      for (int i=0; i<nConnections; ++i)	nAdj[i] = -1;      continue;    }    // Define the number of links    else if (!strcasecmp(t,"m")) {      t = strtok(NULL," \t");      assert(t);      // #of links defined      nLinks = atoi(t);      assert(nLinks > 0);      // Allocate space for sotring lambdas and mus      links = new link_stats[nLinks];      continue;    }    // Enter each route     else if (!strcasecmp(t,"route")) {      assert (nConnections > 0);      assert (nLinks > 0);      t = strtok(NULL," \t");      assert(t);      int i = atoi(t);      assert(i > 0 && i<= nConnections);      i--;      // We dunno whether this will be short flow specs      flows[i].is_sflow = 0; // Lets assume its a normal flow      flows[i].drop = 0; // Assume ideal case to start off      flows[i].scaled = 0; // Not scaled as yet      t = strtok(NULL," \t");      assert(t);      nAdj[i] = atoi(t);      assert(nAdj[i] > 0 && nAdj[i] <= nLinks);      Adj[i] = new int[nAdj[i]];      for (int j=0; j<nAdj[i]; ++j) {	t = strtok(NULL," \t");	assert(t);	int l = atoi(t);	assert(l > 0 && l <= nLinks);	l--;	Adj[i][j] = l;      }      if (MaxHops < nAdj[i]) MaxHops = nAdj[i];            t = strtok(NULL," \t");      // assert(t);          // Short flows stuff       if (t && !strcasecmp(t,"sh")) {	// There are short flows on this route.	flows[i].is_sflow = 1;      	// read the slambda	t = strtok(NULL," \t");	assert(t);	double  tmp = atof(t);	flows[i].slambda = tmp;	// read the snopkts	t = strtok(NULL," \t");	assert(t);	int  tmpi = atoi(t);	flows[i].snopkts = tmpi;      }            continue;    }    else if(!strcasecmp(t,"link")){      assert (nLinks > 0);      // Get the link number      t = strtok(NULL," \t");      assert(t);      int i = atoi(t);      assert(i > 0 && i<= nLinks);      i--;      // Get the prop delay      t = strtok(NULL," \t");      assert(t);      double p = atof(t);      assert(p>=0);       links[i].prop = p;      // Get the lambda for this link      t = strtok(NULL," \t");      assert(t);      p = atof(t);      assert(p>=0);      links[i].lambda = 0;      links[i].tlambda = p;      links[i].plambda = p;      // Get the mu for this link      t = strtok(NULL," \t");      assert(t);      p = atof(t);      assert(p>=0);      links[i].mu = p;      // Get the buffer for this link      t = strtok(NULL," \t");      assert(t);      int t1 = atoi(t);      assert(t1>0);      links[i].buffer = t1;      // Check for RED Q or not      t = strtok(NULL," \t");      if(t && !strcasecmp(t,"red")){	// must be a red queue	// input red parameters	// all parameters between 0 and 1	links[i].red=1;	// get minth	t = strtok(NULL," \t");	double dt = atof(t); 	//assert(dt>=0 && dt<=1);	links[i].minth=dt;	// get pmin	t = strtok(NULL," \t");	dt = atof(t); 	//assert(dt>=0 && dt<=1);	links[i].pmin=dt;	// get maxth	t = strtok(NULL," \t");	dt = atof(t); 	//assert(dt>=0 && dt<=1);	links[i].maxth=dt;	// get pmax	t = strtok(NULL," \t");	dt = atof(t); 	//assert(dt>=0 && dt<=1);	links[i].pmax=dt;	// Invoke Ashish's RED module ... ignore pmin .....	links[i].redrouter = new RedRouter((int)links[i].minth, 					   (int)links[i].maxth,					   links[i].pmax);	assert(links[i].red);      }      else{	links[i].red=0;      }	      continue;    }    assert(0);  }  // Check whether everything is all right   assert (nConnections > 0);  assert (nLinks > 0);  int i;  for (i=0; i<nConnections; ++i)    assert(nAdj[i] > 0);    // check all the edges and store all the connections that flow   // through a particular link    for(i=0;i<nLinks;i++){    //    cout << i << sp;    int c=0; links[i].tlambda=0;    for(int j=0;j<nConnections;j++){      for(int k=0;k<nAdj[j];k++){	if(Adj[j][k]==i){	  c++;	}      }    }    links[i].nflows=c;    //cout << c << sp;    if(c){      links[i].theflows = new int[c];      c = 0;      // Store teh flows      for(int j=0;j<nConnections;j++){	for(int k=0;k<nAdj[j];k++){	  if(Adj[j][k]==i){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
性欧美疯狂xxxxbbbb| 天天爽夜夜爽夜夜爽精品视频| 偷拍与自拍一区| 亚洲特级片在线| 欧洲色大大久久| 午夜成人免费电影| 婷婷开心久久网| 日韩精品亚洲专区| 国产精品全国免费观看高清| 91亚洲精品久久久蜜桃| 日韩激情一区二区| 免费高清在线视频一区·| 欧美国产日韩精品免费观看| 色呦呦日韩精品| 奇米影视一区二区三区| 美女爽到高潮91| 1024成人网| 精品成人一区二区三区四区| 99久久777色| 久久99精品视频| 亚洲国产日产av| 国产精品久久久久久久久免费樱桃 | 一区二区三区精品在线| 精品少妇一区二区三区视频免付费| 成人av综合一区| 久热成人在线视频| 午夜精品福利视频网站| 美国av一区二区| 成人a区在线观看| 欧美日韩dvd在线观看| 91在线精品一区二区| 欧美精品精品一区| 色猫猫国产区一区二在线视频| 成人爽a毛片一区二区免费| 老司机午夜精品| 9i看片成人免费高清| 成人午夜伦理影院| 欧美男女性生活在线直播观看| 成人aa视频在线观看| 中文字幕乱码亚洲精品一区| 亚洲gay无套男同| 大桥未久av一区二区三区中文| 中文字幕精品—区二区四季| 久久国产麻豆精品| 免费亚洲电影在线| 菠萝蜜视频在线观看一区| 制服丝袜亚洲精品中文字幕| 精品一区二区在线视频| 日本久久一区二区| 国产欧美视频一区二区三区| 日韩一区二区在线观看视频播放| 欧美日韩精品欧美日韩精品一| 精品福利一区二区三区免费视频| 一区二区欧美视频| jvid福利写真一区二区三区| 日韩三级视频在线看| 亚洲国产一区视频| 最近中文字幕一区二区三区| 久久精品综合网| 麻豆精品视频在线观看免费| 国产精品香蕉一区二区三区| 国产乱码精品一区二区三| 欧美男男青年gay1069videost| 国产精品美女久久久久久久久| 极品瑜伽女神91| 欧美视频一区在线观看| 91精品国产欧美一区二区成人| www日韩大片| 亚洲欧美在线高清| 国产精品中文字幕日韩精品| 26uuu国产一区二区三区| 久久精品国产一区二区三区免费看| 欧美日韩成人综合| 午夜精品免费在线观看| 欧美色区777第一页| 精品久久久久久久久久久久久久久久久| 一片黄亚洲嫩模| 欧美在线影院一区二区| 亚洲综合在线免费观看| 无吗不卡中文字幕| 6080日韩午夜伦伦午夜伦| 日韩成人免费电影| 成人一区二区三区视频| 国产午夜亚洲精品羞羞网站| 福利一区二区在线观看| 欧美日韩三级一区| 亚洲国产精品久久艾草纯爱| 欧美日韩亚州综合| 日韩av在线播放中文字幕| 日韩美女视频在线| 一区二区久久久久久| 欧美日韩免费观看一区二区三区 | 欧美日韩一区国产| 日韩国产欧美在线视频| 欧美xxxxxxxx| 国产成人高清视频| 欧美成人官网二区| 福利一区在线观看| 亚洲国产一区视频| www久久久久| 成人app软件下载大全免费| 国产欧美日本一区二区三区| 亚洲国产高清aⅴ视频| www.视频一区| 亚洲电影一区二区| 欧美精品一区二区三区在线播放 | 北条麻妃国产九九精品视频| 国产欧美一区二区精品性色超碰| 97久久超碰国产精品电影| 亚洲成人1区2区| 久久亚洲一区二区三区明星换脸 | 亚洲伦理在线精品| 国产中文一区二区三区| 欧美精品久久一区| 成人一区二区三区视频在线观看 | 久久99久久精品| 一区二区三区精品在线观看| 精品福利av导航| 欧美性感一区二区三区| 粉嫩欧美一区二区三区高清影视| 亚洲福利电影网| 日本一区二区三区视频视频| 欧美日韩国产精选| 99精品欧美一区二区三区小说 | 国产精品毛片大码女人| 4438成人网| 色国产精品一区在线观看| 国产在线播精品第三| 欧美一区二区三区系列电影| 99久久婷婷国产综合精品电影| 日韩—二三区免费观看av| 亚洲欧洲制服丝袜| 欧美日韩一区成人| 一本大道综合伊人精品热热| 国产乱对白刺激视频不卡| 蜜桃传媒麻豆第一区在线观看| 亚洲精品免费在线播放| 国产精品无人区| 国产色产综合色产在线视频| 7777精品伊人久久久大香线蕉超级流畅 | 日韩黄色片在线观看| 欧美日韩精品欧美日韩精品一综合| 中文字幕免费不卡| 欧美日韩成人在线| 91久久人澡人人添人人爽欧美 | 蜜桃视频一区二区三区| 亚洲成人免费在线观看| 亚洲人妖av一区二区| 日本一区二区免费在线| 国产亚洲欧美一级| 久久久精品黄色| 久久99久国产精品黄毛片色诱| 亚洲成人777| 亚洲v日本v欧美v久久精品| 亚洲一区二区三区免费视频| 一区二区三区在线视频观看| 亚洲免费三区一区二区| 国产一区二区成人久久免费影院 | 国产一区二区三区在线观看精品| 日日夜夜一区二区| 日本91福利区| 久久国产精品一区二区| 国模冰冰炮一区二区| 国产精品一区在线观看你懂的| 蜜臀久久久久久久| 国内精品视频一区二区三区八戒| 黄色成人免费在线| 国产99精品国产| 成人毛片老司机大片| 91丨porny丨蝌蚪视频| 91国产成人在线| 91精品久久久久久久91蜜桃 | 国产成人亚洲综合a∨婷婷| 国产精品18久久久久久vr| 成年人网站91| 欧美男生操女生| 欧美成人aa大片| 中文子幕无线码一区tr| 亚洲制服欧美中文字幕中文字幕| 欧美日韩中文国产| 亚洲欧洲无码一区二区三区| 国产在线日韩欧美| 午夜激情综合网| 精品一区二区免费在线观看| 国产精品99久久久久久久女警| 99国产精品国产精品久久| 欧美日韩一区三区四区| 久久综合色一综合色88| 亚洲精选在线视频| 激情六月婷婷久久| 色偷偷88欧美精品久久久| 日韩精品一区二区三区四区 | 欧美在线观看视频一区二区三区| 欧美日韩另类国产亚洲欧美一级| 久久中文字幕电影| 亚洲国产va精品久久久不卡综合| 国产一区二区三区免费看 | 久久成人久久爱| 95精品视频在线| 精品国产一区二区三区四区四|