To load this file without formatting, visit http://whoyouknow.co.uk/ants/AntGraph/java/2/src/antgraph/Main.java. This is a spam-protection measure; sorry for the inconvenience.
· Main.java ·
1/* 2 * Main.java 3 * 4 * Created on 02 March 2007, 22:42 5 * 6 * To change this template, choose Tools | Template Manager 7 * and open the template in the editor. 8 */ 9 10package antgraph; 11 12/** 13 * 14 * @author James 15 */ 16public class Main { 17 18 private static Graph graph = new Graph(); 19 20 /** Creates a new instance of Main */ 21 public Main() { 22 } 23 24 public static Graph getGraph() { 25 return graph; 26 } 27 /** 28 * @param args the command line arguments 29 */ 30 public static void main(String[] args) { 31 32 33 34 Node a = new Node("a"); 35 Node b = new Node("b"); 36 Node c = new Node("c"); 37 Node d = new Node("d"); 38 Node e = new Node("e"); 39 Node f = new Node("f"); 40 Node g = new Node("g"); 41 Node h = new Node("h"); 42 Node i = new Node("i"); 43 Node j = new Node("j"); 44 Node k = new Node("k"); 45 Node l = new Node("l"); 46 47 graph.addNode(a); 48 graph.addNode(b); 49 graph.addNode(c); 50 graph.addNode(d); 51 graph.addNode(e); 52 graph.addNode(f); 53 graph.addNode(g); 54 graph.addNode(h); 55 graph.addNode(i); 56 graph.addNode(j); 57 graph.addNode(k); 58 graph.addNode(l); 59 60 try { 61 graph.addEdge(a, c); 62 graph.addEdge(b, c); 63 graph.addEdge(c, d); 64 graph.addEdge(c, h); 65 graph.addEdge(d, e); 66 graph.addEdge(d, f); 67 graph.addEdge(f, g); 68 graph.addEdge(f, j); 69 graph.addEdge(g, j); 70 graph.addEdge(j, i); 71 graph.addEdge(i, k); 72 graph.addEdge(h, k); 73 graph.addEdge(l, k); 74 }catch (NoSuchNodeException ex) { 75 System.out.println(ex); 76 } 77 78 Nest nest = new Nest(c, 50); 79 80 81 82 graph.print(); 83/* 84 System.out.println( graph.getEdges(d)); 85 for(Edge ed : graph.getEdges(d)) { 86 System.out.println(ed.other(d)); 87 } 88 */ 89 90 System.out.println(graph.hasEdge(a, b)); 91 92 } 93 94} 95
· Main.java ends ·
To load this file without formatting, visit http://whoyouknow.co.uk/ants/AntGraph/java/2/src/antgraph/Main.java. This is a spam-protection measure; sorry for the inconvenience.