62,615
社区成员
发帖
与我相关
我的任务
分享
//nodes.h
struct _node {
double x;
double y;
int id;
int nbors;
int round;
int maxnbors;
struct _node** nbhood;
struct _lognode* logs;
};
typedef struct _node node;
struct _logentry {
int id;
double x;
double y;
};
typedef struct _logentry logentry;
struct _lognode {
int round;
int size;
int maxsize;
logentry *log;
};
typedef struct _lognode lognode;
struct _area {
// Main field
node *wsn;
// Attributes
int xsize;
int ysize;
double range;
int nelem;
int nround;
int logsize;
};
#define AREA_FIELDS 6
typedef struct _area area;
struct _alarmStr {
int checker;
int idnode1;
int idnode2;
int round;
int suspectRound;
int suspectNode;
};
typedef struct _alarmStr alarmStr;
//header.h
double randomize(int maxint);
int myerr(char *e);
int draw (area *net, int round);
int dumpOut (area *net);
int restoreWsn (area **net);
double dist (node*, node*);
void printLog(lognode *l, int logsize);
int raiseAlarm(int checker, int checked1, int checked2, int suspectNodeid, int round, int suspRound);
//from mt19973.c
int output0alarms(int round);
int reorder(logentry * logen, int k);
long genrand_int31(void);
unsigned long genrand_int32(void);
void init_by_array(unsigned long init_key[], int key_length);
void init_genrand(unsigned long s);
double genrand_real1(void);
double genrand_real2(void);
double genrand_real3(void);
double genrand_res53(void);
都发出来大家看到的可能性大些,