(int blockHeight)
| 380 | */ |
| 381 | //TODO use logger |
| 382 | public static void writeGraph(int blockHeight) { |
| 383 | try { |
| 384 | FileWriter fw = new FileWriter( |
| 385 | new File(OUT_FILE_URI.resolve("./graph/" + blockHeight + ".txt")), false); |
| 386 | PrintWriter pw = new PrintWriter(new BufferedWriter(fw)); |
| 387 | |
| 388 | for (int index = 1; index <= getSimulatedNodes().size(); index++) { |
| 389 | Node node = getSimulatedNodes().get(index - 1); |
| 390 | for (int i = 0; i < node.getNeighbors().size(); i++) { |
| 391 | Node neighbor = node.getNeighbors().get(i); |
| 392 | pw.println(node.getNodeID() + " " + neighbor.getNodeID()); |
| 393 | } |
| 394 | } |
| 395 | pw.close(); |
| 396 | |
| 397 | } catch (IOException ex) { |
| 398 | ex.printStackTrace(); |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | } |
no test coverage detected