本帖最后由 IT0918liu 于 2014-10-22 17:07:22 编辑

解决方案 »

  1.   

    你找个懂java和c的,按着源码翻译一遍
      

  2.   

    楼主,C源码你自己打开过没,先从头文件看起,我先帮你把头文件贴出来吧//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 6typedef 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);都发出来大家看到的可能性大些,
      

  3.   


    看了啊 不过c语言 早就丢掉了 很多看不懂
    nodes.h 定义了一些结构体 另一个就不知是在干嘛了
     
      

  4.   

    基本上c源码到java上都改好多东西的吧。个人总觉得linux下的c基本都是面向结构的而不是面向对象的
      

  5.   

    Java 学的有点忘记了,很久以前学过的