Examples of topologicalSort()


Examples of Hack.Utilities.Graph.topologicalSort()

        Graph graph = createConnectionsGraph();

        // runs the topological sort, starting from the "master parts" node,
        // which connects to all the parts. This will also check for circles.
        Object[] topologicalOrder = graph.topologicalSort(partsList);

        if (graph.hasCircle())
            throw new HDLException("This chip has a circle in its parts connections");

        // create the partsOrder array, by taking from the topologicalOrder
View Full Code Here

Examples of ptolemy.graph.DirectedAcyclicGraph.topologicalSort()

        if (dag.top() == null) {
            // FIXME: throw exception here
        }

        Schedule schedule = new Schedule();
        Object[] sorted = dag.topologicalSort();

        for (int counter = 0; counter < actorCount; counter++) {
            Firing firing = new Firing();
            firing.setActor((Actor) sorted[counter]);
            schedule.add(firing);
View Full Code Here

Examples of ptolemy.graph.DirectedAcyclicGraph.topologicalSort()

        if (_debugging) {
            _debug("## dependency graph is:" + dependencyGraph.toString());
        }

        Object[] sort = dependencyGraph.topologicalSort();

        if (_debugging) {
            _debug("## Result of topological sort (highest depth to lowest):");
        }
View Full Code Here

Examples of ptolemy.graph.DirectedAcyclicGraph.topologicalSort()

        }

        // NOTE: this topologicalSort can be smarter.
        // In particular, the dependency between ports belonging
        // to the same actor may be considered.
        Object[] sort = portsGraph.topologicalSort();
        int numberOfPorts = sort.length;

        if (_debugging && _verbose) {
            _debug("## Result of topological sort (highest depth to lowest):");
        }
View Full Code Here

Examples of ptolemy.graph.DirectedAcyclicGraph.topologicalSort()

        // Now, all actors are classified.
        // Notice that by now, we have all the discrete actors, but
        // they are not in the topological order. Sort them and
        // create the discrete schedule.
        DirectedAcyclicGraph discreteGraph = _toGraph(discreteActors);
        Object[] discreteSorted = discreteGraph.topologicalSort();

        for (int i = 0; i < discreteSorted.length; i++) {
            Actor actor = (Actor) discreteSorted[i];

            // We want to distinguish the waveform and event generators,
View Full Code Here

Examples of ptolemy.graph.DirectedAcyclicGraph.topologicalSort()

        // Schedule event generators so that they are executed topologically.
        // Treat them as sink actors from the point of view of a
        // continuous phase of execution.
        if (!eventGenerators.isEmpty()) {
            DirectedAcyclicGraph eventGraph = _toGraph(eventGenerators);
            Object[] eventSorted = eventGraph.topologicalSort();

            for (int i = 0; i < eventSorted.length; i++) {
                Actor actor = (Actor) eventSorted[i];

                // If this actor is both an event generator and
View Full Code Here

Examples of ptolemy.graph.DirectedGraph.topologicalSort()

            List locallyModifiedAttributeList;

            try {
                DirectedGraph graph = _constAnalysis.getDependencyGraph();
                locallyModifiedAttributeList = Arrays.asList(Graph
                        .weightArray(graph.topologicalSort(graph
                                .nodes(locallyModifiedAttributeSet))));
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
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.