本文整理了Java中org.gephi.layout.plugin.force.yifanHu.YifanHuLayout
类的一些代码示例,展示了YifanHuLayout
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YifanHuLayout
类的具体详情如下:
包路径:org.gephi.layout.plugin.force.yifanHu.YifanHuLayout
类名称:YifanHuLayout
[英]Hu's basic algorithm
[中]胡的基本算法
代码示例来源:origin: org.gephi/layout-plugin
@Override
public YifanHuLayout buildLayout() {
YifanHuLayout layout = new YifanHuLayout(this, new ProportionalDisplacement(1f));
return layout;
}
代码示例来源:origin: org.gephi/layout-plugin
@Override
public void resetPropertiesValues() {
setStepRatio((float) 0.95);
setRelativeStrength((float) 0.2);
if (graph != null) {
setOptimalDistance((float) (Math.pow(getRelativeStrength(), 1.0 / 3) * getAverageEdgeLength(graph)));
} else {
setOptimalDistance(100.0f);
}
setInitialStep(optimalDistance / 5);
setStep(initialStep);
setQuadTreeMaxLevel(10);
setBarnesHutTheta(1.2f);
setAdaptiveCooling(true);
setConvergenceThreshold(1e-4f);
}
代码示例来源:origin: org.gephi/layout-plugin
protected void postAlgo() {
updateStep();
if (Math.abs((energy - energy0) / energy) < getConvergenceThreshold()) {
setConverged(true);
}
}
代码示例来源:origin: gephi/gephi-toolkit-demos
YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
layout.setGraphModel(graphModel);
layout.resetPropertiesValues();
layout.initAlgo();
for (int i = 0; i < 100 && layout.canAlgo(); i++) {
layout.goAlgo();
layout.endAlgo();
代码示例来源:origin: org.gephi/layout-plugin
QuadTree tree = QuadTree.buildTree(graph, getQuadTreeMaxLevel());
BarnesHut barnes = new BarnesHut(getNodeForce());
barnes.setTheta(getBarnesHutTheta());
for (Node node : nodes) {
ForceVector layoutData = node.getLayoutData();
ForceVector f2 = n2.getLayoutData();
ForceVector f = getEdgeForce().calculateForce(n1, n2);
f1.add(f);
f2.subtract(f);
getDisplacement().moveNode(n, force);
postAlgo();
} finally {
graph.readUnlockAll();
代码示例来源:origin: gephi/gephi-toolkit-demos
YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
layout.setGraphModel(graphModel);
layout.resetPropertiesValues();
layout.setOptimalDistance(200f);
layout.initAlgo();
for (int i = 0; i < 100 && layout.canAlgo(); i++) {
layout.goAlgo();
layout.endAlgo();
代码示例来源:origin: org.gephi/layout-plugin
@Override
public YifanHuLayout buildLayout() {
YifanHuLayout layout = new YifanHuLayout(this, new StepDisplacement(1f));
return layout;
}
代码示例来源:origin: gephi/gephi-toolkit-demos
public void run() {
GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace);
AutoLayout autoLayout = new AutoLayout(10, TimeUnit.SECONDS);
autoLayout.setGraphModel(gm);
autoLayout.addLayout(new YifanHuLayout(null, new StepDisplacement(1f)), 1f);
autoLayout.execute();
}
};
代码示例来源:origin: gephi/gephi-toolkit-demos
YifanHuLayout firstLayout = new YifanHuLayout(null, new StepDisplacement(1f));
ForceAtlasLayout secondLayout = new ForceAtlasLayout(null);
AutoLayout.DynamicProperty adjustBySizeProperty = AutoLayout.createDynamicProperty("forceAtlas.adjustSizes.name", Boolean.TRUE, 0.1f);//True after 10% of layout time
内容来源于网络,如有侵权,请联系作者删除!