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

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

?? aggegress-est.cc.cc

?? 在網絡的邊緣路由器中并不能完全接受所到的包
?? CC
字號:

#include "aggegress-est.h"

double AggEgress_Est::tempmeandelay = 0.0;
double AggEgress_Est::tempmaxdelay = 0.0;
int AggEgress_Est::outsideboundcount = 0;
int AggEgress_Est::tempcount = 0;

double AggEgress_Est::arrivalenvelope[17][2];
double AggEgress_Est::serviceenvelope[17][2];

//creating a circular list for storing the maxarrivaltime and minservicetime for every second
//for the last 10seconds

struct maxmintimelist
{
  double maxminarrayoftime[17][2];
  maxmintimelist* next;
};
typedef struct maxmintimelist maxmintimelist;

maxmintimelist *headoflist,*tailoflist,*navigatelist,*nodeoflist;

AggEgress_Est::AggEgress_Est() {

	/* assume period_, T_ and M_ get set in Tcl */
        bind("lifetimeofflow_", &lifetimeofflow_);
        bind("simulationtime_", &simulationtime_);
        bind("delayrequest_", &delayrequest_);
	bind("T_", &T_);
	bind("M_", &M_);
}

void AggEgress_Est::createmaxmintimelist(double a[][2])
{
    nodeoflist = (maxmintimelist*)malloc(sizeof(maxmintimelist));
    for(int i = 0;i < 17;i++)
    {
       nodeoflist->maxminarrayoftime[i][0] = a[i][0];
       nodeoflist->maxminarrayoftime[i][1] = a[i][1];
    }
    nodeoflist->next = NULL;
    
    headoflist = headoflist->next;
    free(tailoflist->next);
    tailoflist->next = nodeoflist;
    tailoflist = tailoflist->next;
    tailoflist->next = headoflist;

}

void AggEgress_Est::initializemaxminlist(void)
{
  int p;
  int q;
  headoflist = NULL;
  tailoflist = NULL;
  navigatelist = NULL;
  nodeoflist = NULL;
  for(p = 0;p < 10;p++)
  {
      nodeoflist = (maxmintimelist*)malloc(sizeof(maxmintimelist));
      for(q = 0;q < 17;q++)
      {
         nodeoflist->maxminarrayoftime[q][0] = 0.0;
         nodeoflist->maxminarrayoftime[q][1] = 0.0;
      }   
      nodeoflist->next = NULL;
        
      if(headoflist==NULL)
      {
         headoflist = nodeoflist;
         tailoflist = nodeoflist;
         navigatelist = nodeoflist;
      }
      else
      {
         navigatelist->next = nodeoflist;
         navigatelist = navigatelist->next;
         tailoflist = navigatelist;
      }
  }
  tailoflist->next = headoflist;
}       
  
void AggEgress_Est::printmaxmintimelist(void)
{
   navigatelist = headoflist;
   int j = 0;
   int i;
   while (navigatelist->next != headoflist)
   {
      printf("The list for table %d is ------------------- \n",j);
      for(i = 0; i < 17; i++)
      {
        printf(" Row %d --------- arrivaltime %f         servicetime %f\n",i,navigatelist->maxminarrayoftime[i][0],navigatelist->maxminarrayoftime[i][1]); 
      }
      navigatelist = navigatelist->next;
      j++;
   }
   
   if(navigatelist->next == headoflist)
   {
      printf("The list for table %d is ------------------- \n",j);
      for(i = 0; i < 17; i++)
      {
        printf(" Row %d --------- arrivaltime %f         servicetime %f\n",i,navigatelist->maxminarrayoftime[i][0],navigatelist->maxminarrayoftime[i][1]);
       }
    }
}

void AggEgress_Est::computemeanmaxdelay(void)
{
    temp = Trace::measure;
    int count = Trace::snoopqueuecount;
    int i;
    double computedelay;

    for(i=0;i <= count;i++)
    {
       computedelay = temp[i].getservicetime() - temp[i].getarrivaltime();
       tempmeandelay = tempmeandelay + computedelay;
       if(tempmaxdelay < computedelay)
       {
          tempmaxdelay = computedelay;
       }
       if(computedelay > delayrequest_)
       {
          outsideboundcount++;
       }
    }
    tempcount = tempcount + count;
}
    
        
 
void AggEgress_Est::extractarrivalservicetimesintoarray()
{
     temp = Trace::measure;

     // extracting the arrival and service times for the packets into an array for computing  

     int count = Trace::snoopqueuecount;

     printf("\n The number of packets which arrived in the 1sec interval are %d \n",count);
 
     int i;

     for(i=0;i <= count;i++)
     {
       arrayoftimes[i][0] = temp[i].getarrivaltime();
       arrayoftimes[i][1] = temp[i].getservicetime();
     }

     for(i = count+1;i < NUMOFPACKS;i++)
     {
       arrayoftimes[i][0] = 0.0;
       arrayoftimes[i][1] = 0.0;
     }
 
   // for(i = 0;i <= count;i++)
   // {
   //   printf(" row %d ------ arrivaltime = %f    servicetime = %f\n",i,arrayoftimes[i][0],arrayoftimes[i][1]);
   // }

     // end of extracting
}

void AggEgress_Est::computationofminarrivalmaxservicetimes()
{ 
   int i;
   int p;
   int j;
   int k;
   int flag;
   double minarrivaltime;
   double maxservicetime;

   //--------- computation of minimum arrival time ------------
 
   p = 0;
   j = 0; 
   while(p < 17)
   {
      // The variable j keeps track of how many packets to consider....i.e 1k,2k,4k....
      j = (int)pow(2,p);
      minarrivaltime = 9999;
      for(i = 0; i < NUMOFPACKS-j; i++)
      {
         if(arrayoftimes[i+j][0] == 0.0)
         {
             break;
         }
         temparrivaltime = arrayoftimes[i+j][0] - arrayoftimes[i][0];
         if(minarrivaltime > temparrivaltime)
         {
            minarrivaltime = temparrivaltime;
         }
      }
      maxmintimes[p][0] = minarrivaltime;
      p++;
    }

    // ---------- end of computation of minimum arrival time -------

    //----------- computation of maximum service time -------------

    p = 0;
    j = 0;
    
    while(p < 17)
    {
       //printf("\n in side the while loop the value of p is %d \n",p);

       j = (int)pow(2,p) - 1;
       maxservicetime = 0.0;

       // this for loop is to extract the max servicetime for packets
       // of size 2 to the power p

       for(i = 0; i < NUMOFPACKS - j; i++)
       {
          if(arrayoftimes[i+j][1] == 0)
          {
             break;
          }
          k = j;
          flag = 0;

          tempservicetime = arrayoftimes[i+k][1] - arrayoftimes[i][0];

          //this tempservicetime should be considered only if there is
          //backlog in the network for (pow(2,p) - 1) packets

          while(k != 0)
          {
             if(arrayoftimes[i+k][0] < arrayoftimes[i+k-1][1])
             {
                flag = 1;
             }
             else
             {
                flag = 0;
                break; 
             }
             k--;
          }//end of the while for k

          if(j == 0)
          {   
            flag = 1;
          }   
          if(flag == 1)  
          {
             if(maxservicetime < tempservicetime)
             {   
                maxservicetime = tempservicetime;
             }
          }
       }//end of the for loop for i
           
       maxmintimes[p][1] = maxservicetime;
       p++;
   }//end of the while for p

  //------------ end of computation --------------------

}

void AggEgress_Est::generatearrivalenvelope()
{
  int j=0;
  double tempmean;
  double tempmeancount;
  double tempvariance;
  double tempvariancecount;
  double mean;
  double variance;

  //The arrival envelope is stored in the array arrivalenvelope 
  //The first column gives the mean and the second column the variance
  
  while(j < 17)
  {
     navigatelist = headoflist;
     tempmean = 0.0;
     tempmeancount = 0;
     while(navigatelist->next != headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][0] != 0 && navigatelist->maxminarrayoftime[j][0] != 9999)
        {
           tempmeancount++;
           tempmean = tempmean + navigatelist->maxminarrayoftime[j][0];
        }
        navigatelist = navigatelist->next;
     }

     if(navigatelist->next == headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][0] != 0 && navigatelist->maxminarrayoftime[j][0] != 9999)
        {
           tempmeancount++;
           tempmean = tempmean + navigatelist->maxminarrayoftime[j][0];
        }
     }

     if(tempmeancount > 0)
     {
        mean = tempmean/tempmeancount;
     }
     else
     {
        mean = 0.0;
     }
     arrivalenvelope[j][0] = mean;

     navigatelist = headoflist;
     tempvariance = 0.0;
     tempvariancecount = 0;

     while(navigatelist->next != headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][0] != 0 && navigatelist->maxminarrayoftime[j][0] != 9999)
        {
           tempvariancecount++;
           tempvariance = tempvariance + ((mean - navigatelist->maxminarrayoftime[j][0])*(mean -navigatelist->maxminarrayoftime[j][0]));
        }
        navigatelist = navigatelist->next;
     }
 
     if(navigatelist->next == headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][0] != 0 && navigatelist->maxminarrayoftime[j][0] != 9999)
        {
          tempvariancecount++;
          tempvariance = tempvariance + ((mean - navigatelist->maxminarrayoftime[j][0])*(mean - navigatelist->maxminarrayoftime[j][0]));
        }
     }
     
     if(tempvariancecount > 1)
     {
        variance = tempvariance / (tempvariancecount-1);
     }
     else
     {
        variance = 0.0;
     }
     arrivalenvelope[j][1] = variance;
    
     j++;
  }

  printf("\n The arrival envelopes are : \n");
  for(j = 0; j < 17; j++)
  {
    printf(" Row %d --------- Mean is %f ..... Variance is %f \n",j,arrivalenvelope[j][0],arrivalenvelope[j][1]);
  }
}
 
void AggEgress_Est::generateserviceenvelope()
{
  int j=0;
  double tempmean;
  double tempmeancount;
  double tempvariance;
  double tempvariancecount;
  double mean;
  double variance;

  //The service envelope is stored in the array service envelope
  //The first column gives the mean and the second column the variance
  
  while(j < 17)
  {
     navigatelist = headoflist;
     tempmean = 0.0;
     tempmeancount = 0;
     while(navigatelist->next != headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][1] != 9999 && navigatelist->maxminarrayoftime[j][1] != 0)
        {
           tempmeancount++;
           tempmean = tempmean + navigatelist->maxminarrayoftime[j][1];
        }
        navigatelist = navigatelist->next;
     }

     if(navigatelist->next == headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][1] != 9999 && navigatelist->maxminarrayoftime[j][1] != 0)
        {
           tempmeancount++;
           tempmean = tempmean + navigatelist->maxminarrayoftime[j][1];
        }
     }

     if(tempmeancount > 0)
     {
        mean = tempmean/tempmeancount;
     }
     else
     {
        mean = 0.0;
     }
     serviceenvelope[j][0] = mean;

     navigatelist = headoflist;
     tempvariance = 0.0;
     tempvariancecount = 0;

     while(navigatelist->next != headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][1] != 9999 && navigatelist->maxminarrayoftime[j][1] != 0)
        {
           tempvariancecount++;
           tempvariance = tempvariance + ((mean - navigatelist->maxminarrayoftime[j][1])*(mean -navigatelist->maxminarrayoftime[j][1]));
        }
        navigatelist = navigatelist->next;
     }
 
     if(navigatelist->next == headoflist)
     {
        if(navigatelist->maxminarrayoftime[j][1] != 9999 && navigatelist->maxminarrayoftime[j][1] != 0)
        {
          tempvariancecount++;
          tempvariance = tempvariance + ((mean - navigatelist->maxminarrayoftime[j][1])*(mean - navigatelist->maxminarrayoftime[j][1]));
        }
     }
     
     if(tempvariancecount > 1)
     {
        variance = tempvariance / (tempvariancecount-1);
     }
     else
     {
        variance = 0.0;
     }
     serviceenvelope[j][1] = variance;
    
     j++;
  }

  printf("\n The service envelopes are : \n");
  for(j = 0; j < 17; j++)
  {
    printf(" Row %d --------- Mean is %f ..... Variance is %f \n",j,serviceenvelope[j][0],serviceenvelope[j][1]);
  }

}  
   

void AggEgress_Est::estimate() 
{
     static int check = 0;
     double meandelay;
     double maxdelay;
     double outsidebound;


     if(check == 0)
     {

        double now2 = Scheduler::instance().clock();
        printf("\n the time in estimate function is %f \n",now2); 

        // This part of the code is for extracting the arrival and service times of the 
        // packets into an array

        extractarrivalservicetimesintoarray();      

        // this part of the code is used for generating the table which contains the
        // maximum arrival time and minimum service time for 1k, 2k, 4k...... 64k

        computationofminarrivalmaxservicetimes();     
  
       // This part of the code is for creating the circular list which keeps data over a 
       // time period of 10 seconds

        createmaxmintimelist(maxmintimes);
       // printmaxmintimelist();

       // This part of the code is for generating the arrival and service envelopes
       
       // The arrival envelope contains the mean and variance of all the arrival times
          generatearrivalenvelope();

       // The service envelope contains the mean and variance of all the service times
          generateserviceenvelope();

          if(now2 > (lifetimeofflow_ + 80.0))
          {
             computemeanmaxdelay();
          }
         
          if(now2 == (simulationtime_ - 1))
          {
             meandelay = tempmeandelay/tempcount;
             maxdelay = tempmaxdelay;
             outsidebound = (double)outsideboundcount/tempcount;
             printf("\n The meandelay is %f \n",meandelay);
             printf("\n The maxdelay is %f \n",maxdelay);
             printf("\n The outsidebound is %f \n",outsidebound);
          }

         Trace::snoopqueueinitialize();
         Trace::setsnoopqueuecount();

     }

     if(check == 0)
     {
        check = 1;
     }
     else
     {
        check = 0;
     }


}

void AggEgress_Est::start() {

	printf("AggTrafEnv_Est::start\n");
        initializemaxminlist();
        //printmaxmintimelist();
	est_timer_.resched(period_);

}

static class AggEgress_EstClass : public TclClass {
public:
	AggEgress_EstClass() : TclClass("Est/AggEgress") {}
	TclObject* create(int, const char*const*) {
		return (new AggEgress_Est());
	}
} class_aggegress_est;


		

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩一区二区三区在线观看| 亚洲妇女屁股眼交7| 最新热久久免费视频| 99久久国产综合色|国产精品| 91高清视频在线| 久久精品一区二区三区不卡牛牛| 亚洲男同1069视频| 国产麻豆日韩欧美久久| 欧美日韩国产天堂| 亚洲欧洲日产国产综合网| 国产剧情一区在线| 日韩午夜激情视频| 调教+趴+乳夹+国产+精品| 91丨porny丨国产入口| 国产香蕉久久精品综合网| 美女网站一区二区| 91麻豆精品国产自产在线| 亚洲综合一区在线| 欧美视频一区二区三区在线观看| 国产精品久久夜| 国产成人福利片| 欧美肥大bbwbbw高潮| 夜色激情一区二区| 一本一本大道香蕉久在线精品| 中文字幕欧美激情| 粉嫩aⅴ一区二区三区四区五区| 精品日韩一区二区三区| 免费成人你懂的| 日韩视频在线观看一区二区| 视频在线观看91| 欧美肥妇free| 免费亚洲电影在线| 日韩欧美一区中文| 久久成人久久鬼色| 精品国产髙清在线看国产毛片 | 欧美在线三级电影| 综合自拍亚洲综合图不卡区| 成人的网站免费观看| 亚洲欧美另类综合偷拍| 91美女在线观看| 亚洲一区二区av在线| 欧美日韩国产大片| 亚洲成av人影院在线观看网| 欧美久久久久久久久| 日日骚欧美日韩| 欧美精品一区二区三区在线播放| 精品系列免费在线观看| 久久综合精品国产一区二区三区| 国产乱码字幕精品高清av | 一区二区三区精品在线| 欧美日韩精品欧美日韩精品一 | 国产亚洲一区二区在线观看| 国产成人综合亚洲91猫咪| ●精品国产综合乱码久久久久| 色菇凉天天综合网| 天堂成人国产精品一区| 久久综合久久综合久久| 成人美女在线视频| 亚洲午夜成aⅴ人片| 日韩写真欧美这视频| 国产精品影视网| 亚洲欧美偷拍另类a∨色屁股| 欧美日韩国产高清一区二区三区 | 欧美日韩一卡二卡| 久久精品免费观看| 中文字幕亚洲综合久久菠萝蜜| 日本电影欧美片| 韩国精品主播一区二区在线观看 | 视频在线观看一区| 日本一区二区三区久久久久久久久不| 不卡免费追剧大全电视剧网站| 亚洲3atv精品一区二区三区| 久久久久久久网| 欧美吻胸吃奶大尺度电影| 91美女精品福利| 欧美国产日韩精品免费观看| 欧洲一区二区av| 国产一区二区三区香蕉| 亚洲精选免费视频| 国产日韩在线不卡| 欧美日韩一区二区三区四区| 丰满放荡岳乱妇91ww| 日产国产欧美视频一区精品| 国产精品国产三级国产aⅴ原创| 欧美日本韩国一区二区三区视频| 国产成人午夜高潮毛片| 日韩电影一二三区| 伊人一区二区三区| 国产精品色呦呦| 精品久久久网站| 欧美挠脚心视频网站| av成人老司机| www.欧美日韩国产在线| 另类人妖一区二区av| 亚洲一级二级在线| 一区免费观看视频| 国产日韩欧美精品在线| 日韩精品专区在线影院观看| 在线一区二区三区| 99re热视频这里只精品| 国产盗摄视频一区二区三区| 精品一区在线看| 五月天激情综合网| 亚洲夂夂婷婷色拍ww47| 亚洲精品自拍动漫在线| 中文字幕综合网| 亚洲天堂a在线| 国产精品麻豆视频| 中文字幕av资源一区| 久久久久青草大香线综合精品| 日韩欧美色综合| 欧美一区二区三区精品| 8v天堂国产在线一区二区| 51精品视频一区二区三区| 欧美精品在线视频| 欧美日韩高清影院| 欧美裸体一区二区三区| 欧美色老头old∨ideo| 欧美日韩国产一级二级| 欧美日韩免费观看一区三区| 在线成人免费观看| 日韩一区二区视频在线观看| 日韩亚洲欧美成人一区| 亚洲精品一区二区三区香蕉| 日韩欧美在线网站| 久久久久久久久99精品| 中文字幕免费不卡| 亚洲乱码国产乱码精品精可以看| 亚洲男帅同性gay1069| 亚洲国产精品久久人人爱蜜臀| 亚洲成人av一区二区| 蜜乳av一区二区三区| 国产精品亚洲视频| 91麻豆视频网站| 91精品国模一区二区三区| 日韩欧美精品三级| 国产精品私人自拍| 亚洲精选一二三| 奇米精品一区二区三区在线观看一 | 亚洲福利电影网| 免费欧美在线视频| 高清国产一区二区| 色拍拍在线精品视频8848| 欧美美女bb生活片| 国产三区在线成人av| 亚洲精品视频免费观看| 免费观看一级特黄欧美大片| 国产高清在线观看免费不卡| 99在线热播精品免费| 91精品国产综合久久香蕉麻豆| 久久九九久久九九| 亚洲综合久久av| 精品一二线国产| 一本高清dvd不卡在线观看| 这里只有精品视频在线观看| 国产欧美一区二区精品忘忧草| 亚洲国产欧美日韩另类综合| 六月丁香婷婷色狠狠久久| 99精品视频在线免费观看| 欧美一区二区三区日韩视频| 亚洲人成在线观看一区二区| 捆绑紧缚一区二区三区视频| 99精品视频一区| 精品国产精品网麻豆系列| 一二三四区精品视频| 高清国产午夜精品久久久久久| 欧美日韩高清一区二区三区| 亚洲欧洲无码一区二区三区| 免费人成精品欧美精品| 欧美性色欧美a在线播放| 欧美国产一区视频在线观看| 免费成人在线观看视频| 一本一本久久a久久精品综合麻豆| 精品美女在线播放| 亚洲电影视频在线| 色婷婷精品大视频在线蜜桃视频| 精品乱码亚洲一区二区不卡| 婷婷综合另类小说色区| 91影院在线免费观看| 中文字幕免费观看一区| 国模一区二区三区白浆| 欧美挠脚心视频网站| 一区二区三区国产精华| 成人高清视频在线观看| 久久精品欧美一区二区三区不卡| 男人的j进女人的j一区| 欧美日韩中文另类| 亚洲精品成人在线| 99久久er热在这里只有精品15| 久久久一区二区三区捆绑**| 美女一区二区久久| 91精品国产综合久久福利软件| 亚洲成人免费在线| 欧美在线播放高清精品| 亚洲美女电影在线| 色欲综合视频天天天| 亚洲视频在线一区| 色噜噜久久综合| 一区二区三区高清| 欧美色中文字幕|