Package org.woped.quantana.graph

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


  }

  // 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

  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

Related Classes of org.woped.quantana.graph.NodePair

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.