tglobaltraffictable.h
来自「片上网络的noxim仿真平台」· C头文件 代码 · 共 64 行
H
64 行
/***************************************************************************** TGlobalTrafficTable.h -- Global Traffic Table definition*****************************************************************************/#ifndef __TGLOBAL_TRAFFIC_TABLE_H__#define __TGLOBAL_TRAFFIC_TABLE_H__//---------------------------------------------------------------------------#include <stdio.h>#include <stdlib.h>#include <vector>#include "NoximDefs.h"using namespace std;//---------------------------------------------------------------------------// Structure used to store information into the tablestruct TCommunication{ int src; // ID of the source node (PE) int dst; // ID of the destination node (PE) float pir; // Packet Injection Rate for the link float por; // Probability Of Retransmission for the link int t_on; // Time (in cycles) at which activity begins int t_off; // Time (in cycles) at which activity ends int t_period; // Period after which activity starts again};//---------------------------------------------------------------------------class TGlobalTrafficTable{public: TGlobalTrafficTable(); // Load traffic table from file. Returns true if ok, false otherwise bool load(const char* fname); // Returns the cumulative pir por along with a vector of pairs. The // first component of the pair is the destination. The second // component is the cumulative shotting probability. double getCumulativePirPor(const int src_id, const int ccycle, const bool pir_not_por, vector<pair<int,double> >& dst_prob); // Returns the number of occurrences of soruce src_id in the traffic // table int occurrencesAsSource(const int src_id);private: vector<TCommunication> traffic_table;};//---------------------------------------------------------------------------#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?