-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pareto front ve Node XP uzerine calismalar...
- Loading branch information
antimon
committed
Apr 23, 2011
1 parent
5706117
commit c9e8487
Showing
4 changed files
with
141 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package edu.atilim.acma; | ||
|
||
import java.io.File; | ||
import java.util.ArrayList; | ||
|
||
public class NodeXPCalculator implements Runnable { | ||
@Override | ||
public void run() { | ||
ArrayList<RunResult> results = new ArrayList<RunResult>(); | ||
|
||
System.out.println("Please enter the results folder location: "); | ||
String root = Console.readLine(); | ||
|
||
if (root.length() == 0) { | ||
root = ".//data//results"; | ||
} | ||
|
||
File rd = new File(root); | ||
|
||
try { | ||
if (rd.exists() && rd.isDirectory()) { | ||
for (File inner : rd.listFiles()) { | ||
if (inner.isDirectory()) { | ||
for (File result : inner.listFiles()) { | ||
if (!result.isFile() || !result.getName().endsWith(".txt")) continue; | ||
|
||
results.add(RunResult.readFrom(result.getAbsolutePath())); | ||
} | ||
} | ||
} | ||
} | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
|
||
StringBuilder sbfull = new StringBuilder(); | ||
StringBuilder sbdata = new StringBuilder(); | ||
|
||
for (int i = 0; i < results.size(); i++) { | ||
RunResult res = results.get(i); | ||
|
||
sbfull.append(res.getBenchmark()).append(';'); | ||
sbfull.append(res.getAttribute("Algorithm")).append(';'); | ||
|
||
sbfull.append(res.getAttribute("NodeExpansion")).append(';'); | ||
sbdata.append(res.getAttribute("NodeExpansion")).append(','); | ||
|
||
if (res.getAttribute("Algorithm").contains("Hill")) { | ||
sbfull.append(res.getFinalDesign().getAppliedActions()); | ||
sbdata.append(res.getFinalDesign().getAppliedActions()); | ||
} else { | ||
sbfull.append(res.getAttribute("Iterations")); | ||
sbdata.append(res.getAttribute("Iterations")); | ||
} | ||
|
||
sbfull.append("\r\n"); | ||
sbdata.append("\r\n"); | ||
} | ||
|
||
System.out.println(sbfull.toString()); | ||
System.out.println(sbdata.toString()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters