Package primitives.graph

Examples of primitives.graph.Node


import primitives.graph.Node;

public class UselessTests {
  public static void main(String[] args){
    Node a = new Node("a");
    Node b = new Node("a");
    System.out.println(a==b);
  }
View Full Code Here


  Node a,b,c,d,e,f;
  List<VecInstruction> program;
  @Before
  public void setUp() throws Exception {
    g = new Graph();
    a = new Node("a");
    b = new Node("b");
    c = new Node("c");
    d = new Node("d");
    e = new Node("e");
    f = new Node("f");
   
    g.addNode(a);
    g.addNode(b);
    g.addNode(c);
    g.addNode(d);
View Full Code Here

  ClusterHead ch;

  @Before
  public void setup() {
    g = new Graph();
    a = new Node("a");
    b = new Node("b");
    c = new Node("c");
    d = new Node("d");
    e = new Node("e");
    f = new Node("f");

    g.addNode(a);
    g.addNode(b);
    g.addNode(c);
    g.addNode(d);
View Full Code Here

  }

  @Test
  public void testSetNodes() {
    Set<Node> ooph = new HashSet<Node>();
    ooph.add( new Node ("test"));
    Set<Node> oldOnes = master.getNodes();
    HashMap<Node,Set<Transition>> oldTransitions = master.getTransitions();
    assertEquals(1,master.getNodes().size());
    master.setNodes(ooph);
    assertEquals(ooph.size(),master.getNodes().size());
    assertSame(ooph,master.getNodes());
    master.setNodes(oldOnes);
    assertFalse(ooph == master.getNodes());
    assertSame(oldOnes,master.getNodes());
    Graph someOtherGraph = new Graph();
    Node a, b;
    a = new Node("a");
    b = new Node("b");
    someOtherGraph.addNode(a);
    someOtherGraph.addNode(b);
    someOtherGraph.connect(a, b, "test");
   
    assertTrue(someOtherGraph.connectivity(a, b));
    assertTrue(a.pathTo(b));
    Set<Node> newOnes = someOtherGraph.getNodes();
   
    master.setNodes(newOnes);
   
    assertFalse(master.getNodes().contains(in));
View Full Code Here

    //make a strongly connected graph
   
    nodes = new ArrayList<Node>();
   
   
        nodes.add(new Node("node 1"));
        nodes.add(new Node("node 2"));
        nodes.add(new Node("node 3"));
   
    nodes.add(new Node("node 4"));
   
   
        for(Node n :nodes){
            g.addNode(n);
        }
View Full Code Here

  }

  @Before
  public void setUp() {

    a = new Node();
    b = new Node();

    g = new Graph();

    g.addNode(a);
    g.addNode(b);
View Full Code Here

  Node a,b,c,d,e,f;
  List<VecInstruction> program;
  @Before
  public void setUp() throws Exception {
    g = new Graph();
    a = new Node("a");
    b = new Node("b");
    c = new Node("c");
    d = new Node("d");
    e = new Node("e");
    f = new Node("f");
   
    g.addNode(a);
    g.addNode(b);
    g.addNode(c);
    g.addNode(d);
View Full Code Here


  }

  public ClusterLeaf(){
    node = new Node();
    id = new HashSet<Integer>();
    id.add(-1);
  }
View Full Code Here

        Matcher m2 = transitionLine.matcher(line);
        if (m2.matches()) {
          String s1 = m2.group(1);
          String s2 = m2.group(2);
          // String s3 = m2.group(3);
          nodes.put(s1, new Node(s1));
          nodes.put(s2, new Node(s2));
        } else {
          String s1 = m.group(1);
          nodes.put(s1, new Node(s1));
        }
      }
    }

    for (String k : nodes.keySet()) {
View Full Code Here

        Matcher m2 = transitionLine.matcher(line);
        if (m2.matches()) {
          String s1 = m2.group(1);
          String s2 = m2.group(2);
          // String s3 = m2.group(3);
          nodes.put(s1, new Node(s1));
          nodes.put(s2, new Node(s2));
        } else {
          String s1 = m.group(1);
          nodes.put(s1, new Node(s1));
        }
      } else {

      }
    }
View Full Code Here

TOP

Related Classes of primitives.graph.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.