gpt4 book ai didi

org.gephi.layout.plugin.force.yifanHu.YifanHuLayout类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 13:19:57 26 4
gpt4 key购买 nike

本文整理了Java中org.gephi.layout.plugin.force.yifanHu.YifanHuLayout类的一些代码示例,展示了YifanHuLayout类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YifanHuLayout类的具体详情如下:
包路径:org.gephi.layout.plugin.force.yifanHu.YifanHuLayout
类名称: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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com