本文整理汇总了Java中org.gephi.layout.plugin.force.yifanHu.YifanHuLayout.canAlgo方法的典型用法代码示例。如果您正苦于以下问题:Java YifanHuLayout.canAlgo方法的具体用法?Java YifanHuLayout.canAlgo怎么用?Java YifanHuLayout.canAlgo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gephi.layout.plugin.force.yifanHu.YifanHuLayout
的用法示例。
在下文中一共展示了YifanHuLayout.canAlgo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: YifanHuLayout_Full_Limited
import org.gephi.layout.plugin.force.yifanHu.YifanHuLayout; //导入方法依赖的package包/类
public static IGraph YifanHuLayout_Full_Limited(final IGraph g, final double optimal_distance,
final double initial_step, final double step_ratio, final double convergence_threshold,
final double barnes_hut_theta, final int max_step, final boolean initialise, final double max_x,
final double max_y) {
initializing();
// System.out.println("Yifan Hu algorithm (bounds limited), starting.");
// System.out.println("converting ...");
IGraph_to_GraphModel(g);
initializing_GraphModel(g);
// System.out.println("graphmodel constructed : " +
// graph_model.getUndirectedGraph().getNodeCount() + " nodes & "+
// graph_model.getUndirectedGraph().getEdgeCount() + " edges.");
final YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
// System.out.println("initialising layout ...");
InitializingYifanHuLayout(layout, optimal_distance, initial_step, step_ratio, convergence_threshold,
barnes_hut_theta);
// System.out.println("initialising algorithm ...");
if (initialise) {
layout.initAlgo();
} else {
// initializing_GraphModel(g);
}
// System.out.println("working ...");
for (int i = 0; i < max_step && layout.canAlgo(); i++) {
layout.goAlgo();
}
layout.endAlgo();
Update_locations(g, max_x, max_y);
// System.out.println("ended.");
return g;
}
示例2: YifanHuLayout_Full_Unlimited
import org.gephi.layout.plugin.force.yifanHu.YifanHuLayout; //导入方法依赖的package包/类
public static IGraph YifanHuLayout_Full_Unlimited(final IGraph g, final double optimal_distance,
final double initial_step, final double step_ratio, final double convergence_threshold,
final double barnes_hut_theta, final int max_step, final boolean initialise) {
initializing();
// System.out.println("Yifan Hu algorithm starting.");
// System.out.println("converting ...");
IGraph_to_GraphModel(g);
initializing_GraphModel(g);
// System.out.println("graphmodel constructed : " +
// graph_model.getUndirectedGraph().getNodeCount() + " nodes & "+
// graph_model.getUndirectedGraph().getEdgeCount() + " edges.");
final YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
// System.out.println("initialising layout ...");
InitializingYifanHuLayout(layout, optimal_distance, initial_step, step_ratio, convergence_threshold,
barnes_hut_theta);
// System.out.println("initialising algorithm ...");
if (initialise) {
layout.initAlgo();
} else {
// initializing_GraphModel(g);
}
// System.out.println("working ...");
for (int i = 0; i < max_step && layout.canAlgo(); i++) {
layout.goAlgo();
// System.out.println("..." + i + "/" + max_step + "/" +
// layout.canAlgo());
}
// System.out.println("... " + layout.canAlgo());
layout.endAlgo();
Update_locations(g);
// System.out.println("ended.");
return g;
}
示例3: applyLayout
import org.gephi.layout.plugin.force.yifanHu.YifanHuLayout; //导入方法依赖的package包/类
public void applyLayout() {
YifanHuLayout layout = new YifanHuLayout(null, new StepDisplacement(1f));
layout.setGraphModel(graphModel);
layout.initAlgo();
layout.resetPropertiesValues();
layout.setOptimalDistance(200f);
for (int i = 0; i < 100 && layout.canAlgo(); i++) {
layout.goAlgo();
}
layout.endAlgo();
}