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

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

?? mmm1.cc

?? SensorSimII is the framework of a simulator that I have been working on to study how future sensor n
?? CC
字號:
/************************************************************************ * @<title> Multiple M/M/1 Simulation </title>@ * * @<h1> Multiple M/M/1 Simulation </h1>@  * This example illustrates how flexible COST/CompC++ is in handling  * variable-size arrays of outports or components.  The sizes of these * arrays are controlled by some simulation parameters that can only * be determined during the runtime.   *  * @<center><img src=mmm1.png></center>@ *  * As shown in the above picture, we will build a simulation consisting * of several multiple M/M/1 systems running independently. It employs  * same @Source@, @FIFO@,  * and @Sink@ as in the @<a href=mm1.cc.html>M/M/1</a> simulation.  * Only the server is different. * * The server we are going to build for this example is a more powerful  * server called @MultiServer@ that can be viewed as a composition of  * multiple servers that runs independently. It is capable of * supporting any number of FIFO queues. As a result, the Multiple  * M/M/1 system has the same number of sources, FIFO queues, and sinks,  * but only one super server. The number of sources, FIFO queues and  * sinks are configurable , i. e., this number can be exported as a  * simulation parameter which is to be assigned * when the system is being instantiated.  *  * @packet_t@, @Source@, @FIFO@, and @Sink@  * are almost identical as those in the @<a href=mm1-cost.cpp>M/M/1</a>@ simulation,  * so we will skip them.  There is only one difference though.  Since there are * no inport arrays, packets arriving at the MultiServer must contain an integral * id to identify the source (and the FIFO queue) from which they are coming from. * This also explains why inport arrays are not essential: a single inport can act * as an inport array if we can find a way to distinguish different sources, based on * either one of the arguments or some special field contained in the data being passed. * * @<!-- ************************************************************************/#define queue_t SimpleQueue#include "../../common/cost.h"/* this defines the packets used in the simulation */struct packet_t{    int seq_number;    int index;    double arrival_time,departure_time;};/* a source component will generate packets at random intervals*/component Source : public TypeII{public:    double interval;    int index;    outport void out (packet_t& p);    MultiTimer <trigger_t> wait;public:    Source();    virtual ~Source() {}    void Start();    inport void create(trigger_t& t, unsigned int);private:	packet_t m_packet;    int m_seq_number;};Source::Source(){    connect wait.to_component,create;}void Source::Start(){    m_seq_number=0;    wait.Set(Exponential(interval));}void Source::create(trigger_t&, unsigned int){    wait.Set(SimTime()+Exponential(interval) );    m_packet.seq_number=m_seq_number++;    m_packet.arrival_time = SimTime();    m_packet.index = index;    out(m_packet);    return;}/* A fifo queue provides a buffer for packets in case the server is busy */template < class DATATYPE >component FIFO : public TypeII{public:    FIFO();    virtual ~FIFO();    void Start();    unsigned int queue_length;    inport void in(DATATYPE& p);    outport void out(DATATYPE& p);    inport void next();private:    bool m_busy;    std::deque<DATATYPE> m_queue;};template < class DATATYPE >FIFO <DATATYPE> :: FIFO(){}template < class DATATYPE >FIFO <DATATYPE> :: ~FIFO(){}template < class DATATYPE >void FIFO <DATATYPE> :: Start(){    m_busy=false;}template < class DATATYPE >void FIFO<DATATYPE>::in(DATATYPE& packet){    if (!m_busy)    { // server is free, we can pass it through        out(packet);        m_busy=true;    }     else if (m_queue.size()<queue_length)    { // queue is not full        	m_queue.push_back(packet);    }    return;}template < class DATATYPE >void FIFO <DATATYPE> :: next(){    if (m_queue.size()>0)    {        out(m_queue.front());        m_queue.pop_front();    }     else    {        m_busy=false;    }    return;}/* a sink collects some statistics */component Sink : public TypeII{public:    inport void in(packet_t&);    void Start()    {        m_total=0.0;        m_number=0;    }    Sink() {}    void Stop()    {        printf("Average packet delay is: %f (%d packets) \n",	       m_total/m_number,m_number);    }private:    double m_total;    int m_number;    packet_t m_packet;};void Sink::in(packet_t &packet){    m_packet=packet;    m_packet.departure_time=SimTime();    m_total+=m_packet.departure_time-m_packet.arrival_time;    m_number++;    return;}/************************************************************************ * -->@   * @<h2>MultiServer</h2>@ * There are several differences between a @MultiServer@ and a simple @Server@. * First, the outport are declared as an array, so an outport * array is actually a collection of almost identical outports, except * each of which is assigned a unique index. Second, we * must allocate enough memory for holding multiple packets being serviced. * Since the number of included sub-servers is controlled by the parameter * @n_servers@, which can only be determined after the component * instance has been created, we must allocate the required space right * before simulation within the @Start()@ function, and, correspondingly, destroy  * it when simulation ends within the @Stop()@ function. * * As mentioned before, the inport @in@ is actually connected to multiple * outports from different FIFO queues.  So to determined from which * the incoming packet arrive, @MultiServer@ must look at the field @index@, which * contains the id of the Source component on which the packet was created. ************************************************************************/template <class DATATYPE>component MultiServer : public TypeII{public:    MultiServer();	virtual ~MultiServer() ;	void Setup();	    double service_time;    int size;    inport void in(DATATYPE& p);    outport[] void out(DATATYPE& p);    outport[] void next();    inport void depart(trigger_t&, unsigned int);/************************************************************************ * Notice the declaration of the timer @wait@.  It is a @MultiTimer@, which is * a timer that can, unlike the simple timer used in the M/M/1 simulation,  * schedule multiple events.  Please refer to the @<a href=manual.html#MultiTimer>manual</a>@ * for more details. ************************************************************************/    MultiTimer<trigger_t> wait;private:    DATATYPE* m_packets;};template <class DATATYPE>MultiServer<DATATYPE>::MultiServer(){    connect wait.to_component,depart;}template <class DATATYPE>MultiServer<DATATYPE>::~MultiServer(){    delete[] m_packets;}/************************************************************************ * Now we need a @Setup@ function.  Remeber the name of this function becomes * merely conventional in COST/CompC++, so you can use any other name. * In this function we must allocate enough space for holding packets according * to the value of the parameter @size@.  @SetSize()@ is a predefined function * for outport arrays which must be called before they can ever be used. ************************************************************************/template <class DATATYPE>void MultiServer<DATATYPE>::Setup(){    m_packets = new DATATYPE [ size ];    out.SetSize(size);    next.SetSize(size);}/************************************************************************ * The field @index@ in the packet is very important.  This index is used  * to tag the event scheduled. We * can think of a timer as a timerarray in which each imaginary timer * is identified by a unique index.  ************************************************************************/template <class DATATYPE>void MultiServer<DATATYPE> :: in(DATATYPE& packet){	int index = packet.index;    m_packets[index]=packet;    wait.Set(SimTime()+Exponential(service_time),index);    return;}/************************************************************************ * Once a departure event is activated, the index of that event is returned * as the second argument. ************************************************************************/template <class DATATYPE>void MultiServer <DATATYPE> :: depart(trigger_t&, unsigned int i){    out[i](m_packets[i]);    next[i]();    return;}/************************************************************************ * @<h2>Building the Duplicate M/M/1 System</h2>@ * @source@, @fifo@, and @sink@ are now defined as component arrays. ************************************************************************/component MMM1 : public CostSimEng{public:    void Setup();	int size;    double interval;    int queue_length;    double service_time;private:    Source[] source;    FIFO <packet_t> [] fifo;    MultiServer <packet_t> server;    Sink[] sink;};/************************************************************************ * We must always first set the size of the component arrays, by calling * there predefined @SetSize()@ functions.  We then assign values to * the parameters of every component in each component array (we cann't * do it at once). ************************************************************************/void MMM1::Setup(){	int i;		source.SetSize(size);	fifo.SetSize(size);	sink.SetSize(size);		for(i=0;i<size;i++)	{    	source[i].interval=interval;    	source[i].index=i;	    fifo[i].queue_length=queue_length;	}	    server.service_time=service_time;    server.size=size;    server.Setup();	for(i=0;i<size;i++)	{	    connect source[i].out,fifo[i].in;    	connect fifo[i].out,server.in;    	connect server.next[i],fifo[i].next;    	connect server.out[i],sink[i].in;    }}/************************************************************************ * @<h2>Running the Duplicate M/M/1 Simulation</h2>@ * Running the simulation is no different.  * * To run the simulation, type in: * * dmm1-cost [number of servers] [stop time] [random seed] ************************************************************************/int main(int argc, char* argv[]){    MMM1 mmm1;	mmm1.size=4;    mmm1.interval=1;    mmm1.queue_length=100;    mmm1.service_time=0.5;    mmm1.StopTime=100000.0;    mmm1.Seed=10;    if (argc>=2)        mmm1.StopTime=atof(argv[1]);    if (argc>=3)		mmm1.Seed=atoi(argv[2]);    mmm1.Setup(); // must be called first    mmm1.Run(); // run the simulation    return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人黄色小说| 国产精品不卡在线| 在线这里只有精品| 99re亚洲国产精品| 成人免费高清视频在线观看| 成人黄页在线观看| 色婷婷综合久久久中文字幕| 色综合天天综合网天天看片| 欧美伊人精品成人久久综合97 | 91小视频在线免费看| 91在线高清观看| 日本韩国精品在线| 欧美三级韩国三级日本三斤| 51午夜精品国产| 日韩欧美亚洲另类制服综合在线| 精品少妇一区二区三区免费观看 | 色素色在线综合| 欧美亚洲综合色| 6080亚洲精品一区二区| 日韩一级片在线观看| 久久久久久久久久久久电影| 国产日韩欧美一区二区三区乱码| 日本一区二区不卡视频| 亚洲欧美一区二区不卡| 五月天一区二区| 精东粉嫩av免费一区二区三区| 国产成人高清视频| 色哟哟精品一区| 日韩一卡二卡三卡四卡| 中文字幕高清一区| 五月天精品一区二区三区| 国内一区二区在线| 色狠狠综合天天综合综合| 7777精品伊人久久久大香线蕉经典版下载 | 调教+趴+乳夹+国产+精品| 国内精品不卡在线| 欧洲国内综合视频| 久久久久久久久一| 午夜精品一区在线观看| 国产成a人亚洲精品| 欧美区视频在线观看| 国产欧美va欧美不卡在线| 午夜欧美视频在线观看| 成人黄色综合网站| 精品久久久久香蕉网| 亚洲精品免费在线| 国产黄色成人av| 欧美精品免费视频| 最新热久久免费视频| 裸体一区二区三区| 欧美三日本三级三级在线播放| 国产午夜亚洲精品理论片色戒| 天天做天天摸天天爽国产一区| 不卡高清视频专区| 久久久久久久久久久久电影| 性感美女久久精品| 色婷婷久久99综合精品jk白丝| 2020国产精品自拍| 日本视频中文字幕一区二区三区| 99综合电影在线视频| 久久精品一二三| 毛片av一区二区| 欧美一区三区二区| 亚洲电影第三页| 欧美优质美女网站| 亚洲美女免费视频| 99久久精品国产精品久久| 26uuu国产日韩综合| 青青青爽久久午夜综合久久午夜| 欧美日韩亚州综合| 亚洲一区二区精品3399| 色综合一区二区三区| 自拍偷自拍亚洲精品播放| 成人精品国产一区二区4080| 国产性做久久久久久| 国产不卡视频一区二区三区| 国产亚洲人成网站| 国产成人综合亚洲网站| 2023国产一二三区日本精品2022| 日本va欧美va欧美va精品| 欧美一级艳片视频免费观看| 日韩国产高清影视| 日韩欧美国产精品一区| 久久99这里只有精品| 久久综合色鬼综合色| 国产一区二区三区高清播放| 久久精品人人爽人人爽| 成人在线一区二区三区| 国产精品动漫网站| 色综合一区二区三区| 亚洲1区2区3区4区| 日韩一区二区三区四区| 国产乱一区二区| 中文字幕在线观看不卡| 91国偷自产一区二区三区成为亚洲经典| 亚洲欧美日韩中文播放| 欧美二区三区的天堂| 经典三级一区二区| 国产精品久久久久久一区二区三区| 99国产精品久久久久| 亚洲va中文字幕| 精品国产乱码久久久久久浪潮 | 欧美三级一区二区| 老司机午夜精品| 国产精品你懂的在线| 欧美伊人久久久久久久久影院| 亚瑟在线精品视频| 久久久不卡网国产精品一区| 色综合天天综合网国产成人综合天 | 综合在线观看色| 欧美情侣在线播放| 国产成人av网站| 一二三区精品福利视频| 51精品秘密在线观看| 国产电影一区在线| 性久久久久久久| 国产欧美中文在线| 欧美美女黄视频| 成人动漫精品一区二区| 青青草国产成人av片免费| 国产精品久久一级| 日韩欧美一区中文| 色综合色综合色综合| 国产精一品亚洲二区在线视频| 亚洲最大成人网4388xx| 久久综合狠狠综合久久综合88| 日本精品一区二区三区高清| 久久99国产精品久久99| 亚洲小说欧美激情另类| 亚洲国产成人午夜在线一区 | 激情综合五月婷婷| 亚洲风情在线资源站| 国产精品嫩草久久久久| 精品久久99ma| 91精品国产综合久久香蕉的特点| 91蝌蚪porny| 成人av在线电影| 在线观看国产日韩| 99久久久久久99| 国产福利一区二区三区| 精品一区二区三区在线播放视频| 亚洲福利一二三区| 尤物视频一区二区| 亚洲人成网站在线| 中文字幕一区二区三区四区不卡| 精品国内片67194| 精品久久人人做人人爽| 欧美一区二区三区免费大片| 欧美日韩国产片| 欧美色综合天天久久综合精品| 99久久精品国产网站| 不卡的av电影| 99久久婷婷国产综合精品电影| 成人福利视频网站| zzijzzij亚洲日本少妇熟睡| 床上的激情91.| heyzo一本久久综合| 99热国产精品| 在线观看免费一区| 欧美吻胸吃奶大尺度电影| 欧美午夜理伦三级在线观看| 精品视频色一区| 91精品一区二区三区久久久久久 | 国产91综合一区在线观看| 国产凹凸在线观看一区二区 | 亚洲免费观看视频| 夜夜嗨av一区二区三区四季av| 一区二区高清免费观看影视大全| 亚洲自拍偷拍欧美| 亚洲mv在线观看| 国内不卡的二区三区中文字幕| 国产精品1024| 91免费观看国产| 欧美丝袜丝交足nylons| 日韩一级黄色大片| 国产精品三级av在线播放| 久久电影国产免费久久电影| 国产主播一区二区| 91女厕偷拍女厕偷拍高清| 欧美日韩国产美| 久久色成人在线| 亚洲色图欧美偷拍| 免费欧美高清视频| 成人av影院在线| 欧美日韩www| 国产日韩精品一区二区三区在线| 亚洲丝袜自拍清纯另类| 日本aⅴ精品一区二区三区| 国产精品99久久久久久久vr| 91麻豆蜜桃一区二区三区| 欧美一区午夜视频在线观看| 国产精品视频第一区| 午夜精品久久久久久久蜜桃app| 国产一区二区看久久| 日本精品一区二区三区四区的功能| 日韩午夜电影av| 一区二区三区四区视频精品免费 | 国产一区二区三区在线观看免费 | 裸体一区二区三区| 色天使色偷偷av一区二区|