forked from hni2/ADMM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProny_common.h~
62 lines (51 loc) · 1.42 KB
/
Prony_common.h~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <cstdio>
#include <cstdlib>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <stdbool.h>
#include <ctime>
#include <cmath>
#include <cfloat>
#include <sstream>
#include <iostream>
#include <pthread.h>
#include <complex>
#include "armadillo"
#include "rpoly.h"
#include <fcntl.h>
#include <vector>
#include <cerrno>
#include <algorithm>
using namespace arma;
using namespace std;
//#define ClientNum 4 //There are four clients in Prony system
//#define Height_H 60
#define NUM 10 // number of machine in the system;
#define PoleNum 2*NUM // number of poles of Laplace transfer equation;
#define ParaNum PoleNum
#define Ts 0.2 // sampling time
#define MSS 200
#define DEFAULT_QUEUE_LEN 10
#define DEFAULT_MAX_BUFFER_LEN 4096
#define SERVER_MAX_BUF 1500
#define MAX_FILENAME_LEN 50
//define the parameter of Delay Model
#define MU 5.3
#define SIGMA 0.078
#define LAMBDA 1.39
#define P 0.58
#define MAX_DELAY 100000000 // 100msec
/* declare global variable*/
//static volatile int Exit_Flag = 0;
int timer_sub(const struct timeval *start_time, const struct timeval *end_time, struct timeval *result);
double RandomGenerator(double mu, double sigma, double lambda, double p);
int set_delay(char ip[], int delay);
void *Server_handle(void * parmPtr);
void Mutex_initialization();
void Mutex_destroy();