Examples of NodePair


Examples of org.apache.cassandra.repair.NodePair

        if (EXECUTE_WRITES)
            testSyncCompleteWrite();

        InetAddress src = InetAddress.getByAddress(new byte[]{127, 0, 0, 2});
        InetAddress dest = InetAddress.getByAddress(new byte[]{127, 0, 0, 3});
        NodePair nodes = new NodePair(src, dest);

        try (DataInputStream in = getInput("service.SyncComplete.bin"))
        {
            // success
            RepairMessage message = RepairMessage.serializer.deserialize(in, getVersion());
            assert message.messageType == RepairMessage.Type.SYNC_COMPLETE;
            assert DESC.equals(message.desc);

            assert nodes.equals(((SyncComplete) message).nodes);
            assert ((SyncComplete) message).success;

            // fail
            message = RepairMessage.serializer.deserialize(in, getVersion());
            assert message.messageType == RepairMessage.Type.SYNC_COMPLETE;
            assert DESC.equals(message.desc);

            assert nodes.equals(((SyncComplete) message).nodes);
            assert !((SyncComplete) message).success;

            // MessageOuts
            for (int i = 0; i < 2; i++)
                assert MessageIn.read(in, getVersion(), -1) != null;
View Full Code Here

Examples of org.candlepin.util.X509V3ExtensionUtil.NodePair

    }

    @Test
    public void compareToEquals() {
        PathNode pn = util.new PathNode();
        NodePair np = new NodePair("name", pn);
        NodePair np1 = new NodePair("name", pn);
        assertEquals(0, np.compareTo(np1));
        assertEquals(np, np1);
    }
View Full Code Here

Examples of org.candlepin.util.X509V3ExtensionUtil.NodePair

    }

    @Test(expected = NullPointerException.class)
    public void nullCompareTo() {
        PathNode pn = util.new PathNode();
        NodePair np = new NodePair("name", pn);
        assertEquals(1, np.compareTo(null));
    }
View Full Code Here

Examples of org.candlepin.util.X509V3ExtensionUtil.NodePair

    }

    @Test
    public void nullEquals() {
        PathNode pn = util.new PathNode();
        NodePair np = new NodePair("name", pn);
        assertFalse(np.equals(null));
    }
View Full Code Here

Examples of org.candlepin.util.X509V3ExtensionUtil.NodePair

    }

    @Test
    public void otherObjectEquals() {
        PathNode pn = util.new PathNode();
        NodePair np = new NodePair("name", pn);
        assertFalse(np.equals(pn));
    }
View Full Code Here

Examples of org.candlepin.util.X509V3ExtensionUtil.NodePair

    }

    @Test
    public void notEqualNodes() {
        PathNode pn = util.new PathNode();
        NodePair np = new NodePair("name", pn);
        NodePair np1 = new NodePair("diff", pn);
        assertTrue(np.compareTo(np1) > 0);
        assertFalse(np.equals(np1));
    }
View Full Code Here

Examples of org.woped.quantana.graph.NodePair

    n.setIteration(s.getIteration());
    Key start = new Key(n.getId(), lambda);
    unfoldedNet.put(start, n);

    LinkedList<NodePair> queue = new LinkedList<NodePair>();
    queue.addLast(new NodePair(s, n));
    runThroughNet(queue);
  }
View Full Code Here

Examples of org.woped.quantana.graph.NodePair

  }

  // rekursive Funktion mit Breitensuche
  private void runThroughNet(LinkedList<NodePair> q) {
    if (!(q.isEmpty())) {
      NodePair np = q.removeFirst();
     
      for (Arc a : np.getFirst().getSuccessor()) {
        Node m = a.getTarget();
        if (!m.isJoinReached()) {
          double val = a.getProbability() * np.getSecond().getTempRuns();
          if (!(val < epsilon)) {
            Node y = new Node(m.getId(), m.getName());
            y.setTempRuns(val);
            m.incIteration();
            y.setIteration(m.getIteration());
            if (m.isAndJoin())
              m.setJoinReached(true);
            np.getSecond().getSuccessor().add(new Arc(y, a.getProbability()));
            Key k = new Key(m.getId(), val);
            unfoldedNet.put(k, y);
           
            if (!(containsElement(q, m)))
              q.addLast(new NodePair(m, y));
          }
        }
      }
     
      runThroughNet(q);
View Full Code Here

Examples of org.woped.quantana.graph.NodePair

  private boolean containsElement(LinkedList<NodePair> q, Node n) {
    boolean contains = false;
    Iterator<NodePair> i = q.iterator();
    while (i.hasNext()) {
      NodePair p = i.next();
      if (n.equals(p.getSecond())) {
        contains = true;
        break;
      }
    }
    return contains;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.