本文整理汇总了Java中science.atlarge.graphalytics.execution.RuntimeSetup类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeSetup类的具体用法?Java RuntimeSetup怎么用?Java RuntimeSetup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeSetup类属于science.atlarge.graphalytics.execution包,在下文中一共展示了RuntimeSetup类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import science.atlarge.graphalytics.execution.RuntimeSetup; //导入依赖的package包/类
@Override
public void run(RunSpecification runSpecification) throws PlatformExecutionException {
BenchmarkRun benchmarkRun = runSpecification.getBenchmarkRun();
BenchmarkRunSetup benchmarkRunSetup = runSpecification.getBenchmarkRunSetup();
RuntimeSetup runtimeSetup = runSpecification.getRuntimeSetup();
PowergraphJob job;
Object params = benchmarkRun.getAlgorithmParameters();
String logPath = benchmarkRunSetup.getLogDir().resolve("platform").toString();
boolean graphDirected = benchmarkRun.getFormattedGraph().isDirected();
String vertexFilePath = runtimeSetup.getLoadedGraph().getVertexPath();
String edgeFilePath = runtimeSetup.getLoadedGraph().getEdgePath();
switch(benchmarkRun.getAlgorithm()) {
case BFS:
job = new BreadthFirstSearchJob(benchmarkConfig, vertexFilePath, edgeFilePath,
graphDirected, (BreadthFirstSearchParameters) params, benchmarkRun.getId(), logPath);
break;
case WCC:
job = new ConnectedComponentsJob(benchmarkConfig, vertexFilePath, edgeFilePath,
graphDirected, benchmarkRun.getId(), logPath);
break;
case LCC:
job = new LocalClusteringCoefficientJob(benchmarkConfig, vertexFilePath, edgeFilePath,
graphDirected, benchmarkRun.getId(), logPath);
break;
case CDLP:
job = new CommunityDetectionJob(benchmarkConfig, vertexFilePath, edgeFilePath,
graphDirected, (CommunityDetectionLPParameters) params, benchmarkRun.getId(), logPath);
break;
case PR:
job = new PageRankJob(benchmarkConfig, vertexFilePath, edgeFilePath,
graphDirected, (PageRankParameters) params, benchmarkRun.getId(), logPath);
break;
case SSSP:
job = new SingleSourceShortestPathsJob(benchmarkConfig, vertexFilePath, edgeFilePath,
graphDirected, (SingleSourceShortestPathsParameters) params, benchmarkRun.getId(), logPath);
break;
default:
throw new PlatformExecutionException("Unsupported algorithm");
}
if (benchmarkRunSetup.isOutputRequired()) {
Path outputFile = benchmarkRunSetup.getOutputDir().resolve(benchmarkRun.getName());
job.setOutputFile(outputFile.toFile());
}
try {
job.run();
} catch (IOException|InterruptedException e) {
throw new PlatformExecutionException("failed to execute command", e);
}
}