⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simulib.h

📁 一个满足各种分布的随机数产生方法,包含了指数分布、几何分布、ELANG分布等等
💻 H
字号:
struct event{
	int    flow_length;
	double arrive_time; //事件到达时间
	double timer;       //定时器
	int type_of_event;  //事件类型
	struct event *link; //用于事件排队
	int source;
	int modular_number;
	int packet_length;
};

struct list_point{
	struct event *head;
	struct event *tail;
	int length;
	double average_length;
};

void sim_init();
//将事件current_event防回到空事件链表
void release_event_list(struct event *current_event);
struct event* get_new_event(); //从空事件链表中取一个事件
//将事件current_event按时间顺序插入事件列表
void insert_processing_list(struct event *current_event);
//将事件current_event防到链表list的末尾
void insert_list(struct list_point *list,struct event *current_event);
struct event *remove_event(struct list_point *list); //从list链表中删除第一个事件
void empty_processing_list(); //清空事件列表
void empty_list(struct list_point *list); //清空list链表

double get_exp_random(double lambuda); //产生一个指数分布的随机数
int get_geometric_random(double average); //产生一个几何分布的随机数
double normal (double x, double s);  //正态变量产生器
double triang (double a, double c, double b); //三角随机变量产生器
double hyperx (double x, double s); //产生超指数分布
double erlang (double x, double s); //产生Erlang分布随机数
double ranf(); //产生(0,1)之间均匀分布的随机数
int random_integer (int i, int n); //产生(i,n)之间均匀分布的整数
double Pareto(double alfa, double k); //Pareto分布变量产生器

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -