Changeset 25 for src/main/java/weka
- Timestamp:
- Oct 8, 2010, 10:28:38 AM (14 years ago)
- Location:
- src/main/java/weka/clusterers/forMetisMQI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/GraphAlgorithms.java
r24 r25 92 92 int verboseLevel = Configuration.instance().getVerboseLevel(); 93 93 GraphsFrame gf = GraphsFrame.instance(); 94 System.out.println("Seed: " + Random.instance().getSeed()); 94 95 System.out.println("Vertex count: " + g.getVertexCount()); 95 96 System.out.println("Edges count: " + g.getEdgeCount()); … … 122 123 System.out.println("Partizione raffinata (MQI)"); 123 124 double newConductance = ((double)mqiBisection.edgeCut() / 2) / Math.min(mqiBisection.getSubgraph().totalDegree(),mqiBisection.getComplement().totalDegree()); 124 System.out.println("Conductance: " + newConductance); 125 System.out.println("Cluster "+ i + ": V=" + clusterGraph.getVertexCount() + ", E=" + clusterGraph.getEdgeCount()+"."); 126 System.out.println("Cluster conductance: " + newConductance); 125 127 126 System.out.println("CLUSTER "+ i + ": V=" + clusterGraph.getVertexCount() + ", E=" + clusterGraph.getEdgeCount()+".");127 128 clusters.add(cluster); 128 129 … … 133 134 } 134 135 } 135 if(verboseLevel > 0) 136 if(verboseLevel > 0) { 136 137 gf.addPanel(Util.panelClusters(gclone, clusters)); 137 gf.setVisible(true); 138 gf.setVisible(true); 139 } 138 140 return clusters; 139 141 } -
src/main/java/weka/clusterers/forMetisMQI/MQI.java
r24 r25 200 200 * (bisection.edgeCut() / 2); 201 201 } 202 System.out.print("."); 202 203 alg.evaluate(); 204 System.out.print("."); 203 205 if(Configuration.instance().getVerboseLevel() > 1) 204 206 GraphsFrame.instance().addPanel(Util.panelFlowGraph(directedGraph, edgeFlowMap)); -
src/main/java/weka/clusterers/forMetisMQI/Random.java
r6 r25 7 7 private static Random instance = null; 8 8 9 private long seed = 1234567890; 10 9 11 /** 10 * Return an instance of a random generator with a defaultseed.12 * Return an instance of a random generator with a random seed. 11 13 * @return 12 14 */ 13 15 public static Random instance() { 14 if(instance == null) 15 instance = new Random(); 16 if(instance == null) { 17 instance = new Random(/*new java.util.Random().nextLong()*/1234567890); 18 } 16 19 return instance; 17 20 } 18 21 19 private Random() { 20 super(1234567890); 22 public long getSeed() { 23 return seed; 24 } 25 26 private Random(long seed) { 27 super(seed); 28 this.seed = seed; 21 29 } 22 30
Note: See TracChangeset
for help on using the changeset viewer.