Package org.jgrapht.traverse

Examples of org.jgrapht.traverse.TopologicalOrderIterator


                    + "<riskwiz  version=\"1.0\"  id=\"" + graph.getName()
                    + "\" numsamples=\"1000\"");
            w.write(">" + ln + "   <nodes>" + ln);

            // Dump out the variables
            for (TopologicalOrderIterator it = new TopologicalOrderIterator(
                    graph); it.hasNext();) {
                BNNode node = (BNNode) it.next();

                if (node.isDecision()) {
                    writeDecision(node, w, ln);
                } else if (node.isUtility()) {
                    writeUtility(node, w, ln);
View Full Code Here


 
    public void execute(BeliefNetwork bn) {
        oredredSets = new Vector<Set<BNNode>>();
        oredredDecisionNodes = new Vector< BNNode>();
    
        for (TopologicalOrderIterator it = new TopologicalOrderIterator(bn); it.hasNext();) {
            BNNode node = (BNNode) it.next();

            if (node.isDecision()) {
                Set<BNNode> parents = bn.getParents(node);

                oredredDecisionNodes.add(node);
View Full Code Here

 
    public static Vector<BNNode> topologicalOrder(BeliefNetwork bn) {
   
        Vector<BNNode> vect = new Vector<BNNode>();

        for (TopologicalOrderIterator it = new TopologicalOrderIterator(bn); it.hasNext();) {
            BNNode node = (BNNode) it.next();

            vect.add(node);
     
        }
        return vect;
View Full Code Here

                + "<smile  version=\"1.0\"  id=\"" + graph.getName()
                + "\" numsamples=\"1000\"");
        w.write(">" + ln + "   <nodes>" + ln);

        // Dump out the variables
        for (TopologicalOrderIterator it = new TopologicalOrderIterator(graph); it.hasNext();) {
            BNNode node = (BNNode) it.next();

            if (node.isDecision()) {
                writeDecision(node, w, ln);
            } else if (node.isUtility()) {
                writeUtility(node, w, ln);
            } else if (node.isDeterministic()) {
                writeDeterministic(node, w, ln);
            } else if (node.isNoisyMax()) {
                writeNoisyMax(node, w, ln);
            } else {
                writeCPT(node, w, ln);
            }

        }
        // Dump out the variables

        w.write("   </nodes>" + ln);
        w.write("   <extensions>" + ln);
        w.write(
                "      <genie version=\"1.0\" app=\"GeNIe 2.0.2937.0\" name= \""
                        + graph.getName() + "\" faultnameformat=\"nodestate\">"
                        + ln);
        for (TopologicalOrderIterator it = new TopologicalOrderIterator(graph); it.hasNext();) {
            BNNode node = (BNNode) it.next();

            writeGenieNode(node, w, ln);

        }
View Full Code Here

  public TopologicalOrderIterator<Duct, Integer> getTopologicalOrderIterator()
    {
    try
      {
      return new TopologicalOrderIterator( ductGraph );
      }
    catch( RuntimeException exception )
      {
      LOG.error( "failed creating topological iterator", exception );
      printGraphError();
View Full Code Here

  public TopologicalOrderIterator<Duct, Integer> getReversedTopologicalOrderIterator()
    {
    try
      {
      return new TopologicalOrderIterator( getReversedGraph() );
      }
    catch( RuntimeException exception )
      {
      LOG.error( "failed creating reversed topological iterator", exception );
      printGraphError();
View Full Code Here

                State s = n.stateInfo.spec.stateFactory.makeState(conf, context, context.getThisTaskIndex(), thisComponentNumTasks);
                context.setTaskData(n.stateInfo.id, s);
            }
        }
        DirectedSubgraph<Node, Object> subgraph = new DirectedSubgraph(_graph, _nodes, null);
        TopologicalOrderIterator it = new TopologicalOrderIterator<Node, Object>(subgraph);
        int stateIndex = 0;
        while(it.hasNext()) {
            Node n = (Node) it.next();
            if(n instanceof ProcessorNode) {
                ProcessorNode pn = (ProcessorNode) n;
                String batchGroup = _batchGroups.get(n);
                if(!_myTopologicallyOrdered.containsKey(batchGroup)) {
                    _myTopologicallyOrdered.put(batchGroup, new ArrayList());
View Full Code Here

                State s = n.stateInfo.spec.stateFactory.makeState(conf, context, context.getThisTaskIndex(), thisComponentNumTasks);
                context.setTaskData(n.stateInfo.id, s);
            }
        }
        DirectedSubgraph<Node, Object> subgraph = new DirectedSubgraph(_graph, _nodes, null);
        TopologicalOrderIterator it = new TopologicalOrderIterator<Node, Object>(subgraph);
        int stateIndex = 0;
        while(it.hasNext()) {
            Node n = (Node) it.next();
            if(n instanceof ProcessorNode) {
                ProcessorNode pn = (ProcessorNode) n;
                String batchGroup = _batchGroups.get(n);
                if(!_myTopologicallyOrdered.containsKey(batchGroup)) {
                    _myTopologicallyOrdered.put(batchGroup, new ArrayList());
View Full Code Here

TOP

Related Classes of org.jgrapht.traverse.TopologicalOrderIterator

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.