• 大小: 31KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-17
  • 语言: Java
  • 标签: Java  RWR  

资源简介

java代码的重启式随机游走代码,运行在Eclipse平台上,转自github,也可以自行下载,可运行,有Demo文件输入

资源截图

代码片段和文件信息

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;

public class Config {

Properties properties = new Properties();
String configFile = “config.properties“;

int MajorNodeThreshold;
double OverlapThreadshold;
double PreliminaryThreshold;
double RestartProbability;
String node_path;
String edge_path;

public Config(){

try {
    properties.load(new InputStreamReader(new FileInputStream(configFile) “UTF-8“));
    
} catch (FileNotFoundException ex) {
    ex.printStackTrace();
    return;
} catch (IOException ex) {
    ex.printStackTrace();
    return;
}

// 第二個參數為預設值,如果沒取到值的時候回傳預設值
MajorNodeThreshold = Integer.parseInt(properties.getProperty(“MajorNodeThreshold“ “15“));
OverlapThreadshold = Double.parseDouble(properties.getProperty(“OverlapThreadshold“ “0.4“));
PreliminaryThreshold = Double.parseDouble(properties.getProperty(“PreliminaryThreshold“ “0.014“));
RestartProbability = Double.parseDouble(properties.getProperty(“RestartProbability“ “0.65“));
node_path = properties.getProperty(“node_path“““);
edge_path = properties.getProperty(“edge_path“““);
//System.out.println(edge_path+MajorNodeThreshold);

}

public int getMajorNodeThreshold(){
return MajorNodeThreshold;
}

public double getOverlapThreadshold(){
return OverlapThreadshold;
}

public double getPreliminaryThreshold(){
return PreliminaryThreshold;
}

public double getRestartProbability(){
return RestartProbability;
}

public String getNode_path(){
return node_path;
}

public String getEdge_path(){
return edge_path;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-10-19 09:58  RWR_Cluster-master\
     文件         295  2015-10-19 09:58  RWR_Cluster-master\.classpath
     文件         370  2015-10-19 09:58  RWR_Cluster-master\.project
     目录           0  2015-10-19 09:58  RWR_Cluster-master\.settings\
     文件         587  2015-10-19 09:58  RWR_Cluster-master\.settings\org.eclipse.jdt.core.prefs
     文件          60  2015-10-19 09:58  RWR_Cluster-master\Edge.txt
     文件           5  2015-10-19 09:58  RWR_Cluster-master\Node.txt
     目录           0  2015-10-19 09:58  RWR_Cluster-master\bin\
     文件        2101  2015-10-19 09:58  RWR_Cluster-master\bin\Config.class
     文件        1618  2015-10-19 09:58  RWR_Cluster-master\bin\Edge.class
     文件        2851  2015-10-19 09:58  RWR_Cluster-master\bin\Graph.class
     文件        4021  2015-10-19 09:58  RWR_Cluster-master\bin\GraphGenerator.class
     文件        6513  2015-10-19 09:58  RWR_Cluster-master\bin\Matrix.class
     文件         932  2015-10-19 09:58  RWR_Cluster-master\bin\Node.class
     文件        3728  2015-10-19 09:58  RWR_Cluster-master\bin\NodeCluster.class
     文件         922  2015-10-19 09:58  RWR_Cluster-master\bin\RWRClustering$1.class
     文件       10570  2015-10-19 09:58  RWR_Cluster-master\bin\RWRClustering.class
     文件         195  2015-10-19 09:58  RWR_Cluster-master\config.properties
     目录           0  2015-10-19 09:58  RWR_Cluster-master\src\
     文件        1754  2015-10-19 09:58  RWR_Cluster-master\src\Config.java
     文件         777  2015-10-19 09:58  RWR_Cluster-master\src\Edge.java
     文件        1360  2015-10-19 09:58  RWR_Cluster-master\src\Graph.java
     文件        4639  2015-10-19 09:58  RWR_Cluster-master\src\GraphGenerator.java
     文件        8875  2015-10-19 09:58  RWR_Cluster-master\src\Matrix.java
     文件         360  2015-10-19 09:58  RWR_Cluster-master\src\Node.java
     文件        2610  2015-10-19 09:58  RWR_Cluster-master\src\NodeCluster.java
     文件       17749  2015-10-19 09:58  RWR_Cluster-master\src\RWRClustering.java

评论

共有 条评论