Examples of DirectedGraph


Examples of ptolemy.graph.DirectedGraph

     *  _constructDependencyGraph() to build a starting point.
     *  @return A dependency graph with nodes for ports but no edges.
     */
    protected final DirectedGraph _constructDisconnectedDependencyGraph() {
        // construct new directed graph
        DirectedGraph dependencyGraph = new DirectedGraph();

        // include all the externally visible ports of the associated actor
        // as nodes in the graph
        Iterator inputs = ((Actor) getContainer()).inputPortList()
                .listIterator();

        while (inputs.hasNext()) {
            IOPort input = (IOPort) inputs.next();
            dependencyGraph.addNodeWeight(input);
        }

        Iterator outputs = ((Actor) getContainer()).outputPortList()
                .listIterator();

        while (outputs.hasNext()) {
            IOPort output = (IOPort) outputs.next();
            dependencyGraph.addNodeWeight(output);
        }

        return dependencyGraph;
    }
View Full Code Here

Examples of ptolemy.graph.DirectedGraph

        // We do not need the validity checking because this method is
        // only called from the _constructDependencyGraph() method, which
        // again can only be accessed from the _validate() method.
        // The _validate() method does the validity checking already
        // and gets the read access of workspace.
        DirectedGraph dependencyGraph = _dependencyGraph;

        // Note we can not use iterator here because the edges() method
        // returns an unmodifiableList. The removeEdge() method will cause
        // a concurrentModification exception.
        Object[] edges = dependencyGraph.edges().toArray();

        for (int i = 0; i < edges.length; i++) {
            Edge edge = (Edge) edges[i];

            if (edge.source().getWeight().equals(inputPort)
                    && edge.sink().getWeight().equals(outputPort)) {
                dependencyGraph.removeEdge(edge);
            }
        }
    }
View Full Code Here

Examples of ptolemy.graph.DirectedGraph

        for (Iterator variables = variableSet.iterator(); variables.hasNext();) {
            Variable variable = (Variable) variables.next();
            _variableToChangeContext.put(variable, model);
        }

        _dependencyGraph = new DirectedGraph();

        _collectConstraints(model);
        _analyzeAllVariables();
    }
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

     */
    public PropAntiArborescences(IntVar[] succs, int offSet, boolean linear) {
        super(succs, PropagatorPriority.LINEAR, false);
        this.n = succs.length;
        this.offSet = offSet;
        this.connectedGraph = new DirectedGraph(n + 1, SetType.BITSET, false);
        if (linear) {
            domFinder = new AlphaDominatorsFinder(n, connectedGraph);
        } else {
            domFinder = new SimpleDominatorsFinder(n, connectedGraph);
        }
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

                }
            }
        }
        n2 = idx;
        fifo = new int[n2];
        digraph = new DirectedGraph(n2 + 1, SetType.BITSET, false);
        free = new BitSet(n2);
        father = new int[n2];
        in = new BitSet(n2);
        SCCfinder = new StrongConnectivityFinder(digraph);
    }
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

    public PropSubcircuit_AntiArboFiltering(IntVar[] succs, int offSet) {
        super(succs, PropagatorPriority.QUADRATIC, true);
        this.n = succs.length;
        this.offSet = offSet;
        this.connectedGraph = new DirectedGraph(n + 1, SetType.LINKED_LIST, false);
        domFinder = new SimpleDominatorsFinder(n, connectedGraph);
        rootCandidates = new int[n];
    }
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

                }
            }
        }
        n2 = idx;
        fifo = new int[n2];
        digraph = new DirectedGraph(solver, n2 + 2, SetType.LINKED_LIST, false);
        free = new BitSet(n2);
        remProc = new DirectedRemProc();
        father = new int[n2];
        in = new BitSet(n2);
        SCCfinder = new StrongConnectivityFinder(digraph);
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

  public PropCircuitSCC(IntVar[] succs, int offSet, CircuitConf conf) {
    super(succs, PropagatorPriority.LINEAR, false);
    this.offSet = offSet;
    n = vars.length;
    n2 = n+1;
    support = new DirectedGraph(n2,SetType.BITSET,true);
    G_R = new DirectedGraph(n2,SetType.LINKED_LIST,false);
    SCCfinder = new StrongConnectivityFinder(support);
    mates = new ISet[n2];
    for(int i=0;i<n2;i++){
      mates[i] = SetFactory.makeLinkedList(false);
    }
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

    public PropSubCircuitSCC(IntVar[] succs, int offSet) {
        super(succs, PropagatorPriority.LINEAR, false);
        this.offSet = offSet;
        n = vars.length;
        n2 = n + 1;
        support = new DirectedGraph(n2, SetType.LINKED_LIST, true);
        G_R = new DirectedGraph(n2, SetType.LINKED_LIST, false);
        SCCfinder = new StrongConnectivityFinder(support);
        mates = new ISet[n2];
        for (int i = 0; i < n2; i++) {
            mates[i] = SetFactory.makeLinkedList(false);
        }
View Full Code Here

Examples of util.objects.graphs.DirectedGraph

    public PropCircuit_ArboFiltering(IntVar[] succs, int offSet, CircuitConf conf) {
        super(succs, PropagatorPriority.QUADRATIC, false);
        this.conf = conf;
        this.n = succs.length;
        this.offSet = offSet;
        this.connectedGraph = new DirectedGraph(n + 1, SetType.BITSET, false);
        domFinder = new SimpleDominatorsFinder(n, connectedGraph);
        if (conf == CircuitConf.RD) {
            rd = new Random(0);
        }
    }
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.