Skip to content

Commit

Permalink
changed --threads to --nthreads. ignore case
Browse files Browse the repository at this point in the history
  • Loading branch information
jgould committed Dec 17, 2018
1 parent 1047ebf commit 24763e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Flag | Description | Default Value
--nsteps | Number of iterations | 1000
--barnesHutOptimize | Whether to use Barnes-Hut optimization (true or false) | true
--undirected | Whether input graph is undirected | true
--threads | Number of threads to use. | All cores
--nthreads | Number of threads to use. | All cores
--format | Output file format. One of csv, gdf, gexf, gml, graphml, pajek, txt | txt
--barnesHutSplits | Number of splits to use for Barnes-Hut tree building. Number of threads used is 8 to the power barnesHutSplits | 1
--coords | Tab separated file containing initial coordinates with headers id, x, y, and, z |
Expand Down
Binary file modified dist/forceatlas2-3d.jar
Binary file not shown.
16 changes: 7 additions & 9 deletions src/org/gephi/layout/plugin/forceAtlas2_3d/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ private static void writeOutput(Graph g, boolean is3d, Set<String> formats, Stri
}

private static void addArg(String flag, String description, boolean required, Object defaultValue) {
argsMap.put("--" + flag, new Arg(flag, description, required, "" + defaultValue));
argsMap.put("--" + flag.toLowerCase(), new Arg(flag, description, required, "" + defaultValue));
}

private static void addArg(String flag, String description, boolean required) {
argsMap.put("--" + flag, new Arg(flag, description, required, null));
argsMap.put("--" + flag.toLowerCase(), new Arg(flag, description, required, null));
}

private static String getArg(String flag) {
Arg a = argsMap.get("--" + flag);
Arg a = argsMap.get("--" + flag.toLowerCase());
return a != null ? a.value : null;
}

Expand All @@ -73,11 +73,10 @@ public static void main(String[] args) throws IOException {
addArg("nsteps", "Number of iterations", false, 1000);
addArg("barnesHutOptimize", "Whether to use Barnes-Hut optimization (true or false)", false, true);
addArg("undirected", "Whether input graph is undirected", false, true);
addArg("threads", "Number of threads to use. If not specified will use all cores", false);
addArg("nthreads", "Number of threads to use. If not specified will use all cores", false);
addArg("barnesHutSplits", "Number of splits to use for Barnes-Hut tree building. Number of threads used is 8 to the power barnesHutSplits", false);
addArg("format", "Output file format. One of csv, gdf, gexf, gml, graphml, pajek, txt", false);
addArg("coords", "Tab separated file containing initial coordinates with headers id, x, y, and, z", false);

addArg("barnesHutTheta", " Theta of the Barnes Hut optimization", false);
addArg("jitterTolerance", "How much swinging you allow. Above 1 discouraged. Lower gives less speed and more precision.", false);
addArg("linLogMode", "Switch ForceAtlas' model from lin-lin to lin-log (tribute to Andreas Noack). Makes clusters more tight.", false);
Expand All @@ -90,7 +89,7 @@ public static void main(String[] args) throws IOException {
addArg("updateCenter", "Update Barnes-Hut region centers every updateCenter iterations when not rebuilding Barnes-Hut tre", false);

for (int i = 0; i < args.length; i++) {
Arg a = argsMap.get(args[i]);
Arg a = argsMap.get(args[i].toLowerCase());
if (a == null) {
System.err.println("Unknown argument " + args[i]);
continue;
Expand All @@ -99,7 +98,6 @@ public static void main(String[] args) throws IOException {
a.value = value;
}


Long seed = null;
int threadCount = Runtime.getRuntime().availableProcessors();
Double barnesHutTheta = null;
Expand Down Expand Up @@ -127,8 +125,8 @@ public static void main(String[] args) throws IOException {
if (getArg("barnesHutSplits") != null) {
barnesHutSplits = Integer.parseInt(getArg("barnesHutSplits"));
}
if (getArg("barnesHutSplits") != null) {
threadCount = Integer.parseInt(getArg("barnesHutSplits"));
if (getArg("nthreads") != null) {
threadCount = Integer.parseInt(getArg("nthreads"));
}

if (getArg("barnesHutTheta") != null) {
Expand Down

0 comments on commit 24763e1

Please sign in to comment.