Skip to content

Commit

Permalink
More command line parsing bug fixes. Added toString in ForceAtlas
Browse files Browse the repository at this point in the history
  • Loading branch information
jgould committed Dec 17, 2018
1 parent 24763e1 commit 5876b54
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
Binary file modified dist/forceatlas2-3d.jar
Binary file not shown.
24 changes: 24 additions & 0 deletions src/org/gephi/layout/plugin/forceAtlas2_3d/ForceAtlas2.java
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,30 @@ public LayoutProperty[] getProperties() {
return properties.toArray(new LayoutProperty[0]);
}

@java.lang.Override
public java.lang.String toString() {
return "ForceAtlas2{" +
"outboundAttCompensation=" + outboundAttCompensation +
", edgeWeightInfluence=" + edgeWeightInfluence +
", jitterTolerance=" + jitterTolerance +
", scalingRatio=" + scalingRatio +
", gravity=" + gravity +
", speed=" + speed +
", speedEfficiency=" + speedEfficiency +
", outboundAttractionDistribution=" + outboundAttractionDistribution +
", adjustSizes=" + adjustSizes +
", barnesHutOptimize=" + barnesHutOptimize +
", barnesHutTheta=" + barnesHutTheta +
", linLogMode=" + linLogMode +
", strongGravityMode=" + strongGravityMode +
", threadCount=" + threadCount +
", currentThreadCount=" + currentThreadCount +
", updateBarnesHutIter=" + updateBarnesHutIter +
", updateCenter=" + updateCenter +
", barnesHutSplits=" + barnesHutSplits +
'}';
}

private static class SpeedTask implements Callable<Double[]> {
private Collection<Node> nodes;

Expand Down
33 changes: 22 additions & 11 deletions src/org/gephi/layout/plugin/forceAtlas2_3d/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,38 @@ public static void main(String[] args) throws IOException {

if (getArg("barnesHutTheta") != null) {
barnesHutTheta = Double.parseDouble(getArg("barnesHutTheta"));
} else if (getArg("jitterTolerance") != null) {
}
if (getArg("jitterTolerance") != null) {
jitterTolerance = Double.parseDouble(getArg("jitterTolerance"));
} else if (getArg("linLogMode") != null) {
}
if (getArg("linLogMode") != null) {
linLogMode = getArg("linLogMode").equalsIgnoreCase("true");
} else if (getArg("scalingRatio") != null) {
}
if (getArg("scalingRatio") != null) {
scalingRatio = Double.parseDouble(getArg("scalingRatio"));
} else if (getArg("gravity") != null) {
}
if (getArg("gravity") != null) {
gravity = Double.parseDouble(getArg("gravity"));
} else if (getArg("strongGravityMode") != null) {
}
if (getArg("strongGravityMode") != null) {
strongGravityMode = getArg("strongGravityMode").equalsIgnoreCase("true");
} else if (getArg("outboundAttractionDistribution") != null) {
}
if (getArg("outboundAttractionDistribution") != null) {
outboundAttractionDistribution = getArg("outboundAttractionDistribution").equalsIgnoreCase("true");
} else if (getArg("seed") != null) {
}
if (getArg("seed") != null) {
seed = Long.parseLong(getArg("seed"));
} else if (getArg("format") != null) {
}
if (getArg("format") != null) {
formats.add(getArg("format"));
} else if (getArg("barnesHutUpdateIter") != null) {
}
if (getArg("barnesHutUpdateIter") != null) {
barnesHutUpdateIter = Integer.parseInt(getArg("barnesHutUpdateIter"));
} else if (getArg("updateCenter") != null) {
}
if (getArg("updateCenter") != null) {
updateCenter = getArg("updateCenter").equalsIgnoreCase("true");
} else if (getArg("coords") != null) {
}
if (getArg("coords") != null) {
coordsFile = new File(getArg("coords"));
if (!coordsFile.exists()) {
System.err.println(coordsFile + " not found.");
Expand Down

0 comments on commit 5876b54

Please sign in to comment.